I'm using array_push method to get all the integers into array as follows.
$response = json_decode($jsonResponse);
foreach($response as $item) { //foreach element in $response
$type = $item;
$unique_id = $type->id;
$id_array=array();
array_push($id_array, $unique_id);
}
var_dump($id_array);
But the $id_array contains only last integer element. Is there any wrong with above code or can't we push integer elements into php array?