Programming/PHP / / 2020. 11. 4. 17:52

Convert object to array in php

728x90
$object = "나는 일단 object라고 가정하고...";
foreach((array)$object as $key => $value) {
	...do something...
}

echo count((array)$object);

 

반응형