FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Replaceing a text with an image.





Diablosblizz
EDIT: FIXED MYSELF!
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?
Related topics
Tools you use
Free Online Games (Do not make more new threads about this)
CSS layout help
Adsense lies
What are your Firefox extensions
Feedback Please
Google AdSense Question
Text - Image
I Need an Ultimate Paint Tutorial
Video Editing Tutorial needed. Paying 800 Fri$
Layout is all messed up when viewed via IE.
how many adsense units allow?
old styles?
ANDYS ART
The adsense Links.
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

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