You are here: Re: In search of a span of class. « PHP Programming Language « IT news, forums, messages
Re: In search of a span of class.

Posted by R. Rajesh Jeba Anbiah on 11/18/49 11:55

Paul Lautman wrote:
> Within a subsection of an HTML document (not a complete page), there will be
> a few spans with the class "room_headings"
> e.g.
> <span class="room_headings"> Double
> Room</span>
>
> Can folks suggest some nice ways of extracting all the text contents of such
> spans into a list (for use in a drop-down select list)?

XPath can be used if the contents are valid XML:
$xml = new SimpleXMLElement( '<foo><span
class="room_headings">DoubleRoom</span> <span
class="room_headings">DoubleRoom</span><span
class="room_headings1">DoubleRoom</span></foo>');
print_r($xml->xpath('//span[@class="room_headings"]'));

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

 

Navigation:

[Reply to this 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

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