需要操作的數(shù)據(jù):
復(fù)制代碼代碼如下:
$test =Array
(
[0] => stdClass Object
(
[tags] => 最快的車(chē),Bloodhound,SSC
[id] => 48326888
)
)
從網(wǎng)上查到的方法是 用get_object_vars 把類類型轉(zhuǎn)換成數(shù)組 然后在用 foreach 遍歷即可
$array = get_object_vars($test);