Home  >  Article  >  Backend Development  >  my blow jober act implementation code for traversing stdclass object in PHP

my blow jober act implementation code for traversing stdclass object in PHP

WBOY
WBOYOriginal
2016-07-29 08:45:335397browse

Data that needs to be manipulated:

Copy code The code is as follows:


$test =Array
(
[0] => stdClass Object
(
[tags] => The fastest car, Bloodhound, SSC
[id] => 48326888
)
)


The method found on the Internet is to use get_object_vars to convert the class type into an array and then use foreach to traverse it
$array = get_object_vars($test);

The above introduces the implementation code of traversing stdclass object in my blow jober act PHP, including the content of my blow jober act. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn