开发者

how to fetch array object elements in php within an array

开发者 https://www.devze.com 2023-04-01 12:50 出处:网络
I am going through a php script which has something like this echo \"<pre>\"; var_export($someObj->details);

I am going through a php script which has something like this

echo "<pre>";
var_export($someObj->details);
echo "</pre>";
开发者_如何转开发

and the output is something like : http://pastebin.com/gEAFg6R4

now how do I fetch paricular lines for eg if I just want to fetch the height, if have vehicle or not and is male or female ? what is var_export($someObj->details); doing ?


Please study the PHP manual on arrays http://php.net/manual/en/language.types.array.php - the third example shows how to access nested array contents.

In your case it would be:

print $someObj->details["city"];

print $someObj->details["details"]["have_vehicle"];

Can't tell for the rest, as your output paste is incomplete.

0

精彩评论

暂无评论...
验证码 换一张
取 消