stdClass Object
(
[return] => [
{
"date":"19.02.2021",
"time_start":"16:00:00",
"duration":900,
"time_end":"16:15:00",
"employee_id":"01234567890"
},
{
"date":"19.02.2021",
"time_start":"16:15:00",
"duration":900,
"time_end":"16:30:00",
"employee_id":"01234567890"
},
{
"date":"20.02.2021",
"time_start":"10:45:00",
"duration":900,
"time_end":"11:00:00",
"employee_id":"gbkdbfndsbvvfnsd"
}
]
)
[0]=>19.02.2021
[1]=>19.02.2021
[2]=>20.02.2021
<?php
$obj = new stdClass();
$obj->return = '[
{
"date":"19.02.2021",
"time_start":"16:00:00",
"duration":900,
"time_end":"16:15:00",
"employee_id":"01234567890"
},
{
"date":"19.02.2021",
"time_start":"16:15:00",
"duration":900,
"time_end":"16:30:00",
"employee_id":"01234567890"
},
{
"date":"20.02.2021",
"time_start":"10:45:00",
"duration":900,
"time_end":"11:00:00",
"employee_id":"gbkdbfndsbvvfnsd"
}
]';
$json = json_decode($obj->return);
$res = array_map(function($item) {
return $item->date;
}, $json);
var_dump($res);
<?php
$obj = new stdClass;
$obj->return = '[
{
"date":"19.02.2021",
"time_start":"16:00:00",
"duration":900,
"time_end":"16:15:00",
"employee_id":"01234567890"
},
{
"date":"19.02.2021",
"time_start":"16:15:00",
"duration":900,
"time_end":"16:30:00",
"employee_id":"01234567890"
},
{
"date":"20.02.2021",
"time_start":"10:45:00",
"duration":900,
"time_end":"11:00:00",
"employee_id":"gbkdbfndsbvvfnsd"
}
]';
// JSON-строку (ключ 'return' в объекте) в ассоциативный массив,
// затем из полученного массива выбрать ключи-колонки 'date':
$result = array_column(json_decode($obj->return, true), 'date');
print_r($result);