title: How the get line by line keys and values of one level JSON in PHP
body: <p>I am receiving a JSON array from Javascript as a $_POST variable.</p>
  
  <p>I want to get all variables and its values of the JSON. I tried to use json_decode with foreach like bellow but it did not work. my php code is</p>
  
  <pre><code>&lt;?php
  
  $string = $_POST['json'];
  var_dump(json_decode($string, true));
  foreach($string as $key =&gt; $value) {
    echo $key . " : " . $value;
  }
  
  ?&gt;
  </code></pre>
  
  <p>my json is</p>
  
  <pre><code>[{"EXTAPP_ID":"9901","CATEGORY_ID":"10","LANGUAGE_CODE":"tr","CATEGORY_LANG_DESC":"TR AAA"},{"EXTAPP_ID":"9901","CATEGORY_ID":"10","LANGUAGE_CODE":"de","CATEGORY_LANG_DESC":"DE AAA"},{"EXTAPP_ID":"9901","CATEGORY_ID":"20","LANGUAGE_CODE":"de","CATEGORY_LANG_DESC":"DE XXX"},{"EXTAPP_ID":"9901","CATEGORY_ID":"20","LANGUAGE_CODE":"tr","CATEGORY_LANG_DESC":"TR YYY"},{"EXTAPP_ID":"9901","CATEGORY_ID":"10","LANGUAGE_CODE":"en","CATEGORY_LANG_DESC":"EN ZZZ"},{"EXTAPP_ID":"9901","CATEGORY_ID":"20","LANGUAGE_CODE":"en","CATEGORY_LANG_DESC":"EN VVV"}]
  </code></pre>
  
  <p>it returns the request as a array like bellow (I did not paste all result)</p>
  
  <pre><code>array(6) {
    [0]=&gt;
    array(4) {
      ["EXTAPP_ID"]=&gt;
      string(4) "9901"
      ["CATEGORY_ID"]=&gt;
      string(2) "10"
      ["LANGUAGE_CODE"]=&gt;
      string(2) "tr"
      ["CATEGORY_LANG_DESC"]=&gt;
      string(19) "TR XXX"
    }
    [1]=&gt;
    array(4) {
      ["EXTAPP_ID"]=&gt;
      string(4) "9901"
      ["CATEGORY_ID"]=&gt;
      string(2) "10"
      ["LANGUAGE_CODE"]=&gt;
      string(2) "de"
      ["CATEGORY_LANG_DESC"]=&gt;
      string(17) "TR YYY"
    }
    [2]=&gt;
  </code></pre>
  
  <p>what I expected was</p>
  
  <pre><code>EXTAPP_ID: 9901
  CATEGORY_ID:10
  LANGUAGE_CODE:de
  CATEGORY_LANG_DESC:DE AAA
  </code></pre>