誰でも私がこれを達成する方法を知っています:
投稿メッセージと「*」タグの間のすべてを色付けしたい。このような:
This [*]is[*] test [*]message[*] :)
に:
This [yellow]is[/yellow]> test [yellow]message[/yellow] :)
私は自分の目標を達成するために次のようなものを書きました:
if(preg_match_all('/\*(.*?)\*/',$message,$match)) {
$beforemessage = explode("*", $message, 2);
$message = $beforemessage[0]. " <font color='yellow'>" .$match[0][0]. "</font>";
}
ただし、以下のみが返されます。
This [yellow]is[yellow]