I have some xml, this is a simple version of it.
item one item two
You need to call attributes() function.
Sample code:
$xmlString = ' item one item two '; $xml = new SimpleXMLElement($xmlString); foreach( $xml->items->item as $value){ $my_array[] = strval($value->attributes()); } print_r($my_array);
Eval