title: convert query String to json in php
body: <p>I send a QueryString formatted text like bellow to a php Script via Ajax:</p>
  
  <pre><code>title=hello&amp;custLength=200&amp;custWidth=300  
  </code></pre>
  
  <p>And I want to convert this text to a JSON Object by this result in PHP:</p>
  
  <pre><code>{
      "title" : "hello",
      "custLength" : 200,
      "custWidth" : 300
  }
  </code></pre>
  
  <p>How can i do that. Does anyone have a solution?</p>
  
  <p><strong>Edit :</strong> 
  In fact i have three element in a form by <strong>title</strong> , <strong>custLength</strong> and <strong>custWidth</strong> names and i tried to send these elements via <strong>serialize()</strong> jquery method as <strong>one parameter</strong> to PHP script.   </p>
  
  <p>this code is for Send data to php:  </p>
  
  <pre><code>    customizingOptions  =   $('#title,#custLength,#custWidth').serialize();
  
  $.post('cardOperations',{action:'add','p_id':p_id,'quantity':quantity,'customizingOptions':customizingOptions},function(data){
  
  if (data.success){
  
      goBackBtn('show');
  
      updateTopCard('new');           
  }                   
  
  },'json');
  </code></pre>
  
  <p>in PHP script i used <strong>json_encode()</strong> for convert only <strong>customizingOptions</strong> parameter to a json.<br>
  But the result was not what I expected and result was a simple Text like this:</p>
  
  <pre><code>"title=hello&amp;custLength=200&amp;custWidth=300"
  </code></pre>