I have e.g. example:
$some_text='some example text [title=some_title]some title[/title] next text';
and I want make function, which will search for the word.
I make function:
function text_check($text,$search_word)
{
$text = preg_replace('/'.$search_word.'/i','<span style="color: red;">'.$search_word.'</span>',$text);
return $text;
}
$search='title';
echo text_check($some_text,$search);
How to construct a function of instruction which will steer clear of the bbcode [title=some_title]?