title: PHP AJAX Json send object error
body: <pre><code>var workerEdit = { 
      id: id, 
      name: $('#workers_response input[name="name"][data-id="gear-'+id+'"]').val(),
      photo: $('#workers_response input[name="pas-scan"][data-id="gear-'+id+'"]')[0].files[0],
      bibliography: $('#workers_response textarea[name="bibliography"][data-id="gear-'+id+'"]').val(),
      history: $('#workers_response textarea[name="history"][data-id="gear-'+id+'"]').val(), 
      salary: $('#workers_response input[name="salary"][data-id="gear-'+id+'"]').val()
  }
  </code></pre>
  
  <p>i create this object, then i use ajax to send data throw method POST:</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "/admin-workers/edit_worker.php",
      data: 'edit_worker='+JSON.stringify(input_data),
  
      success: function(data) { 
          var obj = JSON.parse(data); 
          if(obj.error === undefined) { 
              console.log(obj); 
              if(obj.data === null) { 
                  alert("Успех"); 
              } 
          } 
          else { 
              alert("Ошибка: "+obj.error); 
              console.log(obj); 
          } 
      }, 
  });
  </code></pre>
  
  <p>and in php i use:</p>
  
  <pre><code>$edit_worker = json_decode($_POST['edit_worker']);
  $test = $edit_worker-&gt;name;
  </code></pre>
  
  <p>Why doesn't php get the object?</p>