Welcome to WebmasterWorld Guest from 54.160.131.144

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Getting node values as a string (XML)

     

optik

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

5+ Year Member



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.

jd01

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

WebmasterWorld Senior Member 10+ Year Member



This isn't really my thing, but how are you trying to test and see if it's set?

optik

8:52 am on Oct 4, 2009 (gmt 0)

5+ Year Member



if($title){

}

WesleyC

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

5+ Year Member



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.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month