tags:

views:

286

answers:

1

I'm using the simplexml extentsion and AMFPHP to send xml data to flash.

Say I have this xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<people>
  <person>
   <name>bob</name>
  </person>
</people>

And I load it in with simplexml_load_file(). When I do this:

$name = $xml->person[0]->name;
return $name;

it returns "<name>bob</name>". Why is it returning the tags? When I do this with just php and not AMFPHP it works fine.

A: 

I wanna know the answer to this too

Ok, i found out how to solve this :

You basically have to type it to a string, float, double, int, or whatever you need...


$xml = simplexml_load_file(XML_FILE_LOCATION);

$start = (double)$xml->layer[2]['start'];

//$title = (string)$xml->layer[2]['title'];

return $start;

Tim