This script is getting all of my contacts in JSON and show the results in a div
window.location.href = 'gonative://contacts/getAll?callback=contacts_callback';
function contacts_callback(data) {
document.getElementById('demo').innerHTML = JSON.stringify(data);
}
I want to convert the whole JSON to be displayed in PHP array and echo the first contact name:
$soJSON = "<div id='demo'></div>";
$soArray = json_decode($soJSON, true);
echo $soArray["contacts"][0]["givenName"];
This way i don't see anything but if i change the $soJSON to a demo code than it works.
I need the result to be from my contacts phone and not from the demo.