例如:
array(3) { [0]=> object(stdClass)#6 (2)
{ ["id"]=> string(1) "1" ["topic_name"]=> string(5) "janus" }
[1]=> object(stdClass)#7 (2)
{ ["id"]=> string(2) "10" ["topic_name"]=> string(8) "emulsion" }
[2]=> object(stdClass)#33 (2)
{ ["id"]=> string(2) "14" ["topic_name"]=> string(8) "particle" } }
如果转换成数组?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
不太严格要求性能且编码是
utf-8的情况下就:如果严格要求的话,根据情况循环处理吧
用foreach就可以
谢邀。
直接通过常用的->获取类属性的方式进行操作,如果需要获取当中有什么元素的化可以使用反射实现
ReflectionObject::getProperties
写个函数,用上array_map