View Full Version : Switching some strings for other strings.

03-19-2004, 12:22 AM
Alright, if anyone has ever seen those BBcode systems, you would know that while editing a post, you might have somthing like:

"[ quote ]blahblahblah[ /quote ]"

and then when it ould run therough the php it interpreted

[ quote ]

as, say:


and [ /quote ] as another:


How would I have php import a file, and interpret things like [this] and then render as a completly diffrent html code?

04-01-2004, 05:59 AM
Here's one way

$strFile = file_get_contents($file);
$strOutput = str_replace("[break]","<br>", $strFile);