homepage Welcome to WebmasterWorld Guest from 54.204.249.184
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Getting node values as a string (XML)
optik




msg:4000262
 11:40 pm on Oct 2, 2009 (gmt 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.

 

jd01




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

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

optik




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

if($title){

}

WesleyC




msg:4000912
 5:19 pm on Oct 4, 2009 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved