title: An empty JSON object produced by jquery code is wrongly parsed to an empty string in PHP code
body: <p>I am passing a JSON object via ajax to my php file. Then I use the function <code>json_encode</code>, and save it to the database.</p>
  
  <p>The problem is, when the JSON object is empty <code>{}</code>, then in PHP it is not an empty object/array, but it is an empty string <code>""</code>.</p>
  
  <p>I need to deserialize it as encoded (empty JSON object), not as an empty string.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>JQUERY:</p>
  
  <pre><code>                    _key = $(this).data('column-name');
                      _temp = {};
                      $(this).find('&gt; .rc-picker-content  &gt; .rc-picker-item').each(function (__index, $__element) {
                          _temp[__index] = {};
                          _temp[__index] = $(this).attr('data-value');
  
                      });
                      _attr[_key] = _temp; //the variable which is sent via ajax to php
  </code></pre>
  
  <p>PHP</p>
  
  <pre><code>if (isset($_POST['value']) &amp;&amp; is_array($_POST['value'])){
          $_POST['value'] = json_encode($_POST['value']); //this hould be enmpty array not empty string
   }
  </code></pre>