ereg replace?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have a blog type script, I would like to make it automaticly parse img  
files in the blog entry somehow (ie; If I put ""  
it will parse it as "<img src="" border=0  

I'm new to PHP I have read about ereg and other functions like it but I'm  
not sure how to achieve this, the output of my blog is from this

<?php echo $vEntries[$i]['entry']; ?>

Any help would be greatly appreciated.
- Jason  

Re: ereg replace?

Am Fri, 08 Jul 2005 21:49:31 +0000 schrieb JD:

Quoted text here. Click to load it

echo preg_replace('/(http:\/\/)([^ ]+)(\.jpg)/i', '<img src="$1$2$3"
border="0" width="135">', $vEntries[$i]['entry']);

Try this: SCA the Smart Class Archive for PHP

Site Timeline