I want to build this JS to a PHP array:
title : 'Property',
image : '1-1-thmb.png',
type : 'For Sale',
price : '$price',
address : '$address',
bedrooms : '$bedrooms',
bathrooms : '$maxguests',
area : '$area',
position : {
lat : $lat,
lng : $lng
},
markerIcon : 'marker-green.png'
I tried normal PHP array with JSON_ENCODE and PRETTY PRINT, but I dont know how to show the 'position' part inside an array.
Could you please help me?
Thanks in advance,
Tibor
PHP >=5.4
[
'title' => 'Property',
'image' => '1-1-thmb.png',
'type' => 'For Sale',
'price' => '$price',
'address' => '$address',
'bedrooms' => '$bedrooms',
'bathrooms' => '$maxguests',
'area' => '$area',
'position' => [
'lat' => '$lat',
'lng' => '$lng'
],
'markerIcon' => 'marker-green.png'
]