October 2nd, 1999, 08:50 AM
I'm running a php3/mysql driven site
I update my site with an addnews form and that is working ok...
but now i wanted to try to include images in my newspostings...
so i add a form of text in which i just include basic : ) stuff and when they are displayed onscreen the : ) is automatically converted to <img src="images/smiley.gif"> or something similar...
how can i do that ?
October 3rd, 1999, 06:05 AM
The King says: use preg_replace, getImagesize.
$image = "images/smiley.gif";
$imagesize = getImagesize ( $image );
$tag = sprintf("<img src="%s" %s", $image, $imagesize );
$text = preg_replace("/ /", $image, $text);