I have a JSON Object that sent it from android to PHP it's similar to this
{"1":"insert 1", "2":"insert 2", "3":"insert 3" }
the number is the id of the record and the insert is a sql instruction that is executed to save values in a BASE now I need to return my android application in ID of each sentence executed. the sentence is executed well but I do not know how to put into an array those IDs that are the key of each JSON here the code that I use in the server:
foreach ($capturas as $cap ) {
foreach ($cap as $key ) {
$result = pg_query($dbconn,$key) or die("falla");
}
$insertedArray[]=$cap;
}
It is in the insertedArray where I need to save IDs