I'm having trouble accessing the child nodes of my SimpleXML content. I've tried a few variations like $xmlData->id
or $xmlData['id']
.
I'm somewhat new to this area, so any help would be greatly appreciated.
Code sample:
$xmlData = simplexml_load_string($string);
$person = $xmlData->documentElement;
$id = $xmlData->id;
Var dump of $xmlData
from Simple XML:
object(SimpleXMLElement)#23 (10) {
["id"]=> string(10) "yTZn1JIaaa"
["first-name"]=> string(6) "First Name"
["last-name"]=> string(6) "Last Name"...