Android PHP - 获取数组键值

I created a JSON string/object/array in android and passed it to PHP.

PHP code snippet with the following results:

if(isset($_POST['finalobject']))
{
    $finalobject = $_POST['finalobject'];
    error_log("
 ###### finalobjectpost: " . $finalobject ,3,"android_post_array.log");
}

finalobjectpost result:

{"myarray":[{"id":0,"name":0,"year":0,"curriculum":0,"birthday":0},{"id":1,"name":1,"year":1,"curriculum":1,"birthday":1}]}

I need a foreach loop to display the key header, i.e ID, NAME,Year etc.

Use json_decode() function to make json string to array, then use foreach loop to do something you want