Convert SimpleXMLElement Object while parsing from xml

dLukeketts

New Member
\[code\]$drivetracker = simplexml_load_file('geot_5980.xml');$data = http://stackoverflow.com/questions/15709542/array();foreach ($drivetracker->plays->qtr as $qtr):foreach ($qtr->play as $myplay):$hasball = $myplay['hasball'];$play = $myplay['spot'];$down = $myplay['down'];$togo = $myplay['togo'];$type = $myplay['type'];$text = $myplay['text'];array_push($data, array("text" => $text, "spot" => $play, "ball" => $hasball, "togo" => $togo, "type" => $type, "drive"=> $drive) );endforeach;endforeach;print_r($data);\[/code\]I get this...\[code\][16] => Array ( [text] => SimpleXMLElement Object ( [0] => Tanner, C. kick attempt good. ) [spot] => SimpleXMLElement Object ( [0] => DU03 ) [ball] => SimpleXMLElement Object ( [0] => GT ) [togo] => SimpleXMLElement Object ( [0] => 0 ) [type] => SimpleXMLElement Object ( [0] => X ) [drive] => 7 ) [17] => Array ( [text] => SimpleXMLElement Object ( [0] => Tanner, C. kickoff 51 yards to the DU14, Butler, L return 16 yards to the DU30 (Noble, D.). ) [spot] => SimpleXMLElement Object ( [0] => GT35 ) [ball] => SimpleXMLElement Object ( [0] => GT ) [togo] => SimpleXMLElement Object ( [0] => 0 ) [type] => SimpleXMLElement Object ( [0] => K ) [drive] => 7 ))\[/code\]My question is... how do i make it so that instead of \[code\][text] => SimpleXMLElement Object ( [0] => Tanner, C. kick attempt good. )\[/code\]I get \[code\][text] = > "Tanner, C. kick attempt good."\[/code\]
 
Back
Top