FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Replaceing a text with an image.

 


Diablosblizz
EDIT: FIXED MYSELF!

Last edited by Diablosblizz on Tue Jul 31, 2007 9:53 pm; edited 1 time in total
Diablosblizz
SORRY FOR DOUBLE POST, I need this to be figured out:

Code:
<?
function BBCODE($content){ //define the function of bbcode
$content = nl2br($content); //replaces returns with br's
$match = array(
'#\:P#se'
); //codes used in posts
$replace = array(
"'<img src=\"/images/p.gif\" border=\"0\" alt=\"\\1\">'"
); //replacements
return preg_replace($match, $replace, $content); //match, and replace
} //end the function
?>   


Somehow, I was able to get the : P (without the spaces) to work, but not the others. I attempt to add one and it gives me an eror and doesn't show the image. But it works perfectly fine with the above code, but if I add any more it messes up...

Any ideas?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.