-4
文字列をその変数に置き換えます。私はそれが文字列に( ')を受け入れるにはどうすればいいのか分かりますか?例えばPHP - 配列上の文字列を置換する
$string = ' *this* is 'a' test' ';
$regexes = array('/~(.*?)~/six','/\*(.*?)\*/six');
$replaces = array('<i>$1</i>','<b>$1</b>');
$new_string = preg_replace($regexes, $replaces, $string);
echo $new_string;
を言わせて、私はそれが大胆とイタリックテキストに変更することができますが、文字列は 『』「」している場合、それはエラーになります。どのようにこれを達成したいですか?
http://parsedown.org/です! –
'addslashes($ string)'を使用してください。 –
あなたが意味するもの:preg_quote()私は推測します)) – Deep