从PHP获取谷歌地图选项值

In PHP I have an array, I want to use that array in the google map api.

$array = {
    'center' => 'new google.maps.LatLng( 57.70887 , 11.974559999999997 )',
    'zoom' => 12,
    'mapTypeId' => 'google.maps.MapTypeId.ROADMAP'
}

In google map,

var mapcanvas = <?php echo json_encode( $array ); ?>
var map = new google.maps.Map( mapcanvas  , div_map );

Is this possible ???

Yes, this should work just fine.

However, to create an array in php, you should use [] instead of {}