Reply to selecting specific tag

Your name:

Reply:


Posted by Y.G. on 04/03/06 16:40

I am making a script which displays an RSS feed on my website. To do
this I would like to take all the <div class="blabla"><img src="bla.jpg"
alt="bla"> </div> tags and put them in front of my text. So the
following string:

<p>This is text blah blah blah</p>
<div class="blabla"><img src="bla.jpg" alt="bla"> </div>
<p>this is another text</p>

should give as output:

<div class="blabla"><img src="bla.jpg" alt="bla"> </div>
<p>This is text blah blah blah</p>
<p>this is another text</p>


I tried using regular expressions, but I do not really get it done. Here
is the code I use:


while(ereg('/<DIV class=\"blabla\"*>(.*?)<\/DIV>/i',$content, $matches)){
$img=$img.$matches[0];
$content=ereg_replace('/<DIV
class=\"imgbar50\"*>(.*?)<\/DIV>/i',"",$content,1);
}

what do i do wrong?

[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

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