how can i add or insert record(in a form of array) in my json file using php or javascript?
i've tried this one but no luck:
$file = file_get_contents('Copy.json');
$tempArray = json_decode($file);
$arr = array('type' => 'Feature',
'id'=>$adsID,
'properties' => array(
'IMAGE'=>$ALogo,
'NAME'=>$name,
'TEL'=>$ATel,
'URL'=>$url,
'ADRESS1'=>$A_add,
'ADDRESS2'=>'add2',
'CITY'=>'Angeles City',
'ZIP'=>'2009'),
'geometry' => array(
'type' => 'Point',
'coordinates' => array ($ACoords1))
) ;// features
echo json_encode($arr);//$data[] = $_POST['data'];
array_push($tempArray, $arr);
$jsonData = json_encode($tempArray);
file_put_contents('Copy.json', $jsonData);