Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
基本上我有一个格式为:array('context_text'=>some_value,'name'=>some_value,'target'=>{..});
array('context_text'=>some_value,'name'=>some_value,'target'=>{..});
我需要向目标索引添加另一个值,例如:
array('context_text'=>some_value,'name'=>some_value,'target'=>{..},{...},{...});
PHP 的等效 ReQl 代码是什么?
我不确定我是否理解这个问题,但这是答案,至少是一次尝试:
$myArray = array('context_text'=>some_value,'name'=>some_value,'target'=>array('key1' => some_value, 'key2' => some_value));
基本上,您将关联嵌套作为关联array的元素array。如果您想稍后添加元素,可以执行以下操作:
array
$myArray['target']['key3'] = some_value;