why does this code not work?
$content=preg_replace( "/(\[PHP\])(.*)(\[\/PHP\])/isUe"," highlight_string('\\2, 1')");
i dont wanna end up using that BBcode, cause i like to do things my own way...
i get an error.you didnt define what string to perform that action on. also i think you may have mismatched quotes or something
try this, not sure if it will work though, as it is untested
$string = preg_replace("'\\[php\\](.*?)\\[/php\\]'i", highlight_string("\${1}"), $string);
//if that doesnt work do this
$string = preg_replace("'\\[php\\](.*?)\\[/php\\]'i", "\${1}", $string);
$string = highlight_string($string);dont work. you can't use the php tags to do regexp. it escapes everything.
$string = preg_replace('/\[php\](.*?)\[/php\]/'i, highlight_string("\\1"), $string);
//if that doesnt work do this
$string = preg_replace('/\[php\](.*?)\[\/php\]/'i", "\\1", $string);
$string = highlight_string($string);hey scoutt, so what do i do?... parse error with ur code. forgot a " but then an error occurs if u add it.actually take the quote out
$string = preg_replace('/\[php\](.*?)\[\/php\]/'i", "\\1", $string);
$string = highlight_string($string);hmmm it doesnt help much, because it makes EVERYTHING even things that dont have highlighted.....$string = preg_replace('/\[php\](.*?)\[\/php\]/i', highlight_string('\\1'), $string);
$content=preg_replace( "/(\[PHP\])(.*)(\[\/PHP\])/isUe"," highlight_string('\\2, 1')");
i dont wanna end up using that BBcode, cause i like to do things my own way...
i get an error.you didnt define what string to perform that action on. also i think you may have mismatched quotes or something
try this, not sure if it will work though, as it is untested
$string = preg_replace("'\\[php\\](.*?)\\[/php\\]'i", highlight_string("\${1}"), $string);
//if that doesnt work do this
$string = preg_replace("'\\[php\\](.*?)\\[/php\\]'i", "\${1}", $string);
$string = highlight_string($string);dont work. you can't use the php tags to do regexp. it escapes everything.
$string = preg_replace('/\[php\](.*?)\[/php\]/'i, highlight_string("\\1"), $string);
//if that doesnt work do this
$string = preg_replace('/\[php\](.*?)\[\/php\]/'i", "\\1", $string);
$string = highlight_string($string);hey scoutt, so what do i do?... parse error with ur code. forgot a " but then an error occurs if u add it.actually take the quote out
$string = preg_replace('/\[php\](.*?)\[\/php\]/'i", "\\1", $string);
$string = highlight_string($string);hmmm it doesnt help much, because it makes EVERYTHING even things that dont have highlighted.....$string = preg_replace('/\[php\](.*?)\[\/php\]/i', highlight_string('\\1'), $string);