从多维数组访问特定值

我有这个多维数组,我想访问一个特定的值,而不做循环..是否有可能?

这里是数组:

    Array
(
[0] => stdClass Object
    (
        [akeebasubs_user_id] => 205
        [user_id] => 268
        [isbusiness] => 0
        [businessname] => sci555
        [occupation] => 
        [vatnumber] => 
        [viesregistered] => 0
        [taxauthority] => 
        [address1] => Ma. Cristina St.
        [address2] => Negros Oriental
        [city] => Dumaguete
        [state] => IA
        [zip] => 6200
        [country] => BS
        [params] => {"work_telephone":"232424","hospital_company":"sci5","company_introductory":"test","organization_type":"","applicant_url":"www","user_title":"","year_established":"","parent_company":"","r_01":"","r_02":"","r_03":"","r_04":""}
        [notes] => <p>test</p>
    )

)

我想要的是直接访问268user_id


您将需要执行以下操作:

var_dump($array[0]->user_id);

$array是一个包含stdClass对象的stdClass数组(您可以使用->来访问对象属性)。

链接地址: http://www.djcxy.com/p/58161.html

上一篇: Access a specific value from Multidimensional array

下一篇: Using the object operator in PHP