How to display only array value in JSON out in php
I am using below PHP code
echo '{"aaData":'.json_encode($user_details).'}';
And it return below output
{"aaData": [
{"id":"31","name":"Elankeeran","email":"[email protected]","activated":"0","phone":""}
]}
But I need JSON output like below
{"aaData": [
{"31","Elankeeran","[email protected]","0","1234"}
]}
Any one please help on this.
{}refers to an object, and objects must have properties like{"id":"31"}. The output returned by your PHP code is valid JSON.