-2

Basically I have an array in the format: array('context_text'=>some_value,'name'=>some_value,'target'=>{..});

I need to add another value to the target index like:

array('context_text'=>some_value,'name'=>some_value,'target'=>{..},{...},{...});

What is the equivalent ReQl code for PHP for this?

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
Arvi128
  • 13
  • 5
  • You can find some basic PHP ReQL documentation here => http://danielmewes.dnsalias.net/~daniel/php-rql-api/ – dalanmiller Mar 21 '16 at 19:06
  • Thanks a lot ! I got my answers here . They should provide this link after the ReQl driver installation for PHP in the official docs . – Arvi128 Mar 21 '16 at 20:03

1 Answers1

0

I am not sure I understand the question, but here goes the answer, at least an attempt:

$myArray = array('context_text'=>some_value,'name'=>some_value,'target'=>array('key1' => some_value, 'key2' => some_value));

Basically, you nest an associative array as an element of your associative array. If you want to add an element later, you can do something like this:

$myArray['target']['key3']  = some_value;
Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175
  • I got that ,but I need to perform this as a query in RethinkDb . The problem is there are no official support for RethinkDb query in PHP . – Arvi128 Mar 20 '16 at 15:43