Return PHP object by index number (not name)

后端 未结 5 803
不思量自难忘°
不思量自难忘° 2020-11-30 08:13

Goal: retrieve an element of data from within a PHP object by number.

This is the print_r($data) of the object:

stdClass Object
(
    [0] => stdCl         


        
5条回答
  •  囚心锁ツ
    2020-11-30 08:48

    Have you tried a foreach() loop? That should give you all the accessible elements, and the keys it returns may give you a better clue as to how to access them directly.

提交回复
热议问题