【发布时间】:2014-04-02 18:41:15
【问题描述】:
我想要一个多子“键”作为“查找”,以从各种关联数组中获取对象。例如:
$lookup_key = "['objects'][0]['object2']";
// this will be stored so when I need to get an object's value from various different arrays I can use these string to form a lookup key to get certain objects
$object_array= array();
$object_array= ["objects"=>[["object1"=>"boot", "object2"=>"shoe"],"object"], "flowers"];
// using that key get the value
$object_value= $object_array->lookup($lookup_key);
现在 php 是否有一个已经进行这种类型查找的方法,或者我认为它是一个多维键?
任何帮助都会很棒!提前致谢。这是对象查找表的一部分。
【问题讨论】:
-
你能解释一下你想要什么吗??