I want to take out the underlined part of object
id, slot_id, update_time, create_time
Thank you everyone
I want to take out the underlined part of object
id, slot_id, update_time, create_time
Thank you everyone
This is a very simple answer. Just write a method to format this object and convert it into an array. I will provide you with this method,
function object_to_array($obj) { $arr = array(); $_arr = is_object($obj)? get_object_vars($obj) : $obj; foreach ((array)$_arr as $key => $val) { $val = (is_array($val)) || is_object($val) ? object_to_array($val) : $val; $arr[$key] = $val; } return $arr; }
This is the result of executingsql
query! Why didn't you set the format of the returned array? If you don’t have to choose it like this, you can also use it, such asobject->_result[0]['id']
and so on, give it a try
Just look at this array$arr[0]['id']
.
But your array is protected and cannot be taken out.