Jump to content

[SOLVED] str_replace help


adamlacombe

Recommended Posts

I want it so when someone posts [ code ] and [ /code ] it replaces it with <code> and </code>

I have this:

$comment = str_replace([ code ], <code>, $comment);
$comment = str_replace([ /code ], </code>, $comment);

But get this error:

Parse error: syntax error, unexpected '[', expecting ')' in /home/media/test/pages/forum.php on line 328

 

How do I fix it?

 

Thanks in advanced!

Link to comment
https://forums.phpfreaks.com/topic/167305-solved-str_replace-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.