Hi
I'm having rpobs with this because my string pattern to find is "[g]" and when i use the following code :
$str = "this is the text to make [g]bold[/g]";
$str = preg_replace('[g]', '<span class="bold">', $str);
echo '<br>'.$str;
it just outputs this :
this is the text to make []bold[/]
so the problem is obviously the square brackets which seem to have some specific meaning in the regular expression. So i tried escaping the brackets with backslashes but that doesn't work - it just outputs this error:
Warning: Delimiter must not be alphanumeric or backslash in
could someone tell me what i need to do to be able to search for "[g]" and "[/g]" ?
thanks