I need a little help with the ereg_replace function.  I have the following code:

$text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0
\">\\0</a>", $text);

which pads a url with an href tag to make it clickable.  Here's what I would 
like to do:  In the case of the url ending with .gif or .jpg, I would like to 
pad it with an img src tag instead, so it shows up as an actual picture.  Does 
anyone know how I can modify the above code to do this?  Thanks in advance.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to