title: Sending boolean values with $.ajax to PHP
body: <p>I post data to a PHP backend using jQuery <code>$.ajax</code>:</p>
  
  <pre><code>$.ajax({
      url: "server.php",
      method: "post",
      data: {
          testVariable: true
      }
  });
  </code></pre>
  
  <p>On the server side I tried <code>die(gettype($_POST["testVariable"]));</code> which returns <code>string</code>. </p>
  
  <p>I'm trying to save the JSON data posted from Javascript to a MySQL database, but boolean values get quoted which is not what should happen.</p>
  
  <p>What gets inserted is <code>{"testVariable": "true"}</code> and what I need is <code>{"testVariable": true}</code>. How do I accomplish this?</p>