Reply to Re: ereg replace?

Your name:

Reply:


Posted by Markus L. on 07/10/05 03:55

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

> 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 "http://www.test.com/me.jpg"
> it will parse it as "<img src="http://www.test.com/me.jpg" border=0
> width="135">"
>
>
> 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

<?php
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
http://www.project-sca.org
-------------------------------------------------------

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация