PHP JSON ÇIKTI ALMA ...
20.08.2019 - 02:44
Merhabalar,
Aşağıdaki formatta json çıktı üreten sayfam mevcut. Veritabanından çekilen verilere göre bu çıktıyı ürretmem gerekiyor. Ancak json için bulduğum hiç bir örnekte bu tip bi çıktı benzeri göremedim. İşin içinden çıkmadım :)
<?php
$array = array (
'type' => 'FeatureCollection',
'features' =>
array (
0 =>
array (
'type' => 'Feature',
'id' => 0,
'geometry' =>
array (
'type' => 'Point',
'coordinates' =>
array (
0 => 41.008475,
1 => 29.048195,
),
),
'properties' =>
array (
'balloonContent' => 'Turgut (Kurye)',
'clusterCaption' => 'Pharmacy',
'hintContent' => 'Pharmacy',
'iconCaption' => 'Turgut (Kurye)',
),
'options' =>
array (
'preset' => 'islands#blueBicycleIcon',
'iconColor' => 'yellow',
),
),
1 =>
array (
'type' => 'Feature',
'id' => 1,
'geometry' =>
array (
'type' => 'Point',
'coordinates' =>
array (
0 => 41.088277,
1 => 29.076911,
),
),
'properties' =>
array (
'balloonContent' => 'Sezai (Şoför)',
'clusterCaption' => 'Sezai (Şoför)',
'hintContent' => 'Sezai (Şoför)',
'iconCaption' => 'Sezai (Şoför)',
),
'options' =>
array (
'preset' => 'islands#blueDeliveryIcon',
'iconColor' => 'blue',
),
),
),
);
$json = json_encode($array);
echo $json;
?>
228
Görüntülenme
0 Beğeni