I have this array. I have tried a few things but not getting what I want. I tried a foreach loop but it does not seem to do it easly and the process takes a long time.
stdClass Object
(
[data] => Array
(
[0] => stdClass Object
(
[display_number] => 100140
[client] => stdClass Object
(
[name] => TAUQIR SHEIKH ET AL
)
)
[1] => stdClass Object
(
[display_number] => 100141
[client] => stdClass Object
(
[name] => YOLANDA SHEIKH ET AL
)
)
I want it to be one simple array
[0] => Array
(
[0] => 100140
[1] => TAUQIR SHEIKH ET AL
)
[1] => Array
(
[0] => 100141
[1] => YOLANDA SHEIKH ET AL
)
Ok So the old code works but now they updated the API and this made it worse. The response is now
(
[data] => Array
(
[0] => stdClass Object
(
[data] => Array
(
[0] => stdClass Object
(
[display_number] => 100140
[client] => stdClass Object
(
[name] => TAUQIR SHEIKH ET AL
)
)
[1] => stdClass Object
(
[display_number] => 100141
[client] => stdClass Object
(
[name] => YOLANDA SHEIKH ET AL
)
)
I tried this with the new code... But the array is empty. Where am I going wrong?
//clean and make into an array
$matter_array = array();
if(!empty($response_Decode->data->data) &&
is_array($response_Decode->data->data)) {
foreach ($response_Decode->data->data as $info) {
$d = array();
$d[] = $info->display_number;
$d[] = $info->client->name;
$matter_array[] = $d;
}
}
print_r($matter_array); //For testing
die(); //For testing