title: JSON object via jQuery post to php
body: <p>I know, there are plenty of questions out there, but none of them worked for me. </p>
  
  <p>I build an array with normal javascript objects in javascript and sent it via <code>jquery.post</code> to the server. However on the server, I can't access the data using <code>php $obj-&gt;value</code> . I tried <code>json_decode/encode</code> and so on.</p>
  
  <p>This is what <code>console.log(data)</code> gives me, before sending it to the server.</p>
  
  <p><img src="https://i.stack.imgur.com/hDx72.jpg" alt="enter image description here"></p>
  
  <p>Than on the php part I only do this:</p>
  
  <pre><code> $data= $_POST['data'];
   print_r($data);
  </code></pre>
  
  <p>The output of print_r is: </p>
  
  <p><img src="https://i.stack.imgur.com/H4PnS.jpg" alt="enter image description here"></p>
  
  <p>And thats how my Jquery post looks like: </p>
  
  <pre><code>    $.post("programm_eintragen.php",{
              data: data,
  
          }).success(
              function(data){                 
                      //success
  
          }).error(
              function(){
              console.log("Error post ajax " );
          },'json');      
  </code></pre>
  
  <p>Could somebody tell me:</p>
  
  <p><strong>how I can access my object properties on the php site properly?</strong></p>
  
  <p>I also get <code>tried to access non object ....</code> or  php interprets the json object as a string an <code>data[0]</code> returns me  <code>[</code>.</p>
  
  <p>I thought, I could do it like this:</p>
  
  <pre><code>$data[0]-&gt;uebungen[0] 
  </code></pre>
  
  <p><strong>Am I just being silly and missing something?</strong></p>
  
  <p><strong>Why is this whole json sending to php thing such a problem?</strong></p>