title: boolean variable values in PHP to javascript implementation
body: <p>I've run into an odd issue in a PHP script that I'm writing-- I'm sure there's an easy answer but I'm not seeing it.</p>
  
  <p>I'm pulling some vars from a DB using PHP, then passing those values into a Javascript that is getting built dynamically in PHP. Something like this:</p>
  
  <pre><code>$myvar = (bool) $db_return-&gt;myvar;
  
  $js = "&lt;script type=text/javascript&gt;
          var myvar = " . $myvar . ";
          var myurl = 'http://someserver.com/ajaxpage.php?urlvar=myvar';
         &lt;/script&gt;";
  </code></pre>
  
  <p>The problem is that if the boolean value in the DB for "myvar" is <code>false</code>, then the instance of myvar in the $js is null, not <code>false</code>, and this is breaking the script.</p>
  
  <p>Is there a way to properly pass the value <code>false</code> into the myvar variable?</p>
  
  <p>Thanks!</p>