Say I have a variable called $myXMLElement and when I dump the variable it looks like this.
SimpleXMLElement Object (
[@attributes] => Array ( [id] => 7 )
[0] => Kirkpatrick
)
How do I grab the value of Kirkpatrick in PHP
Say I have a variable called $myXMLElement and when I dump the variable it looks like this.
SimpleXMLElement Object (
[@attributes] => Array ( [id] => 7 )
[0] => Kirkpatrick
)
How do I grab the value of Kirkpatrick in PHP
Have you tried:
(string) $var[0]
? Normally you do that with string casting, will turn SimpleXMLElements into the XML nodeValue.