Welcome to WebmasterWorld Guest from 23.22.220.37

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Getting node values as a string (XML)

     
11:40 pm on Oct 2, 2009 (gmt 0)

Full Member

5+ Year Member

joined:Aug 17, 2007
posts:320
votes: 0


I'm using this to get a node value which works fine

$title=$title->item(0)->nodeValue;

But if I want to check whether $title is set I'm given an error saying $title is not a string even though it will echo as a string.

7:26 pm on Oct 3, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 9, 2005
posts:1509
votes: 0


This isn't really my thing, but how are you trying to test and see if it's set?
8:52 am on Oct 4, 2009 (gmt 0)

Full Member

5+ Year Member

joined:Aug 17, 2007
posts:320
votes: 0


if($title){

}

5:19 pm on Oct 4, 2009 (gmt 0)

Full Member

5+ Year Member

joined:July 13, 2007
posts:235
votes: 0


Instead of...

echo $title;

Try testing with this...

var_dump( $title );

That will tell you what type of object the title is, as well as all of its contents.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members