Re: SimpleXMLElement Object into array
- From: Michael Fesser <netizen@xxxxxx>
- Date: Fri, 03 Oct 2008 15:30:39 +0200
..oO(rodeored)
How do I put the value of an SimpleXMLElement Object into any array
If $title is SimpleXMLElement Object ( [0] => Mother )
how do I get "Mother" and put it in an array ? ;
if I echo $title, it says "Mother" but if I put it in an array
$myarray=array($title);
the array is Array ( [0] => SimpleXMLElement Object ( [0] =>
Mother ) )
I don't want that I want
Array ( [0] =>Mother) )
To access a SimpleXMLElement's content you have to cast it to a string.
Sometimes this happens automatically, for example if you print it out or
use any other function that accepts strings values, in cases like above
you have to cast explicitly.
Micha
.
- References:
- SimpleXMLElement Object into array
- From: rodeored
- SimpleXMLElement Object into array
- Prev by Date: Re: Question about PHP and SimpleXML, can i use HTML tags in XML and output it?
- Next by Date: Re: How can I make a var survive page reload?
- Previous by thread: Re: SimpleXMLElement Object into array
- Next by thread: Re: Create passwords for multiple records (PHP/mySQL)
- Index(es):
Relevant Pages
|