I have a SimpleXMLElement and what I want to do is use one of its attributes as an array index:
$element = $xml->path->to->element;
$array = array();
$attribute = $element['attribute'];
$array[$attribute] = 'yadayada';
I get 'Illegal offset type' error. Is it somehow possible to convert the element attribute to string?
Thanks that worked, I forgot typecasting works in PHP.