...

View Full Version : Switching some strings for other strings.



Raraken
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:

<HR>

and [ /quote ] as another:

<HR>

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

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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum