There is a GET request of the form: http://127.0.0.1/test.php?key=foo&value=bar . It is necessary that when clicking on this link in the database (noSQL), the key foo with the value bar is created . How to realize this opportunity? Using json_encode($_GET) we get the string {"key":"foo","value":"bar"} . How can this string be turned into values ​​for transferring them to the database later?

    2 answers 2

    And why do you need json_encode? You already have a key-value array

     insert_into_no_sql_db($_GET['key'], $_GET['value']); 
       $str = '{"key":"foo","value":"bar"}'; $obj = json_decode($str); echo $obj->key; echo $obj->value;