3v4l.org

run code in 300+ PHP versions simultaneously
<?php $longitude = 0; $longitude2 = 0; $lat = 100; $lat2 = 200; $values = array( 'type' => 'FeatureCollection', 'features' => array( array( "geometry"=>array( "type"=> "Point", "coordinates"=> [floatval($longitude),floatval($lat)] ) , "type"=>"Feature", "properties" => array( "description" => "<strong>Visitor No.1</strong>" ), ), array( "geometry"=>array( "type"=> "Point", "coordinates"=> [floatval($longitude2),floatval($lat2)] ) , "type"=>"Feature", "properties" => array( "description" => "<strong>Visitor No.2</strong>" ) ) ) ); // Use json_encode() function $json = json_encode($values); // Display the output echo($json); ?>
Output for git.master, git.master_jit, rfc.property-hooks
{"type":"FeatureCollection","features":[{"geometry":{"type":"Point","coordinates":[0,100]},"type":"Feature","properties":{"description":"<strong>Visitor No.1<\/strong>"}},{"geometry":{"type":"Point","coordinates":[0,200]},"type":"Feature","properties":{"description":"<strong>Visitor No.2<\/strong>"}}]}

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
107.6 ms | 406 KiB | 5 Q