homepage Welcome to WebmasterWorld Guest from 50.17.86.12
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

5+ Year Member



 
Msg#: 4000260 posted 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

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4000260 posted 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

5+ Year Member



 
Msg#: 4000260 posted 8:52 am on Oct 4, 2009 (gmt 0)

if($title){

}

WesleyC

5+ Year Member



 
Msg#: 4000260 posted 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