PHP Simple HTML DOM

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
leewad
Forum Commoner
Posts: 91
Joined: Tue May 11, 2004 8:32 am

PHP Simple HTML DOM

Post by leewad »

Hi

Could anybody please help me out?

I trying to find a node value using Simple HTML DOM

I trying to get the title of all logos on website an example is

Code: Select all

<div class="logos"><img src='images/logo-car99.png' alt='Car99 AMG' title='THE MERC AMG'/></div>
I can get all the data using

Code: Select all

 $logo= $html->find('.logos');  
but just trying to get the title "THE MERC AMG" value
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: PHP Simple HTML DOM

Post by requinix »

If you can't directly get the title attribute, possibly like

Code: Select all

$logo = $html->find('.logos/@title');
then loop over that $logo list and extract the title yourself.
Post Reply