usando la favolosa Serializer di sephiroth
...
file prova.php
codice:
<?php
$ar = Array();
$ar[0] = 'pluto';
$ar['pippo'] = 'paperino';
echo '&array='.urlencode( serialize( $ar ) );
?>
in flash
codice:
var fromPHP:LoadVars = new LoadVars();
fromPHP.onLoad = function( s:Boolean ):Void {
if( s == true ) {
import it.sephiroth.Serializer
var unserialized:Object = new Serializer().unserialize( this['array'] );
// PROVA
trace( unserialized.pippo ); // paperino
trace( unserialized[0] ); // pluto
}
}
fromPHP.load( 'http://localhost/prova.php' );