title: Parsing a string into a boolean value in PHP
body: <p>Today I was playing with PHP, and I discovered that the string values "true" and "false" are not correctly parsed to boolean in a condition, for example considering the following function:</p>
  
  <pre><code>function isBoolean($value) {
     if ($value) {
        return true;
     } else {
        return false;
     }
  }
  </code></pre>
  
  <p>If I execute:</p>
  
  <pre><code>isBoolean("true") // Returns true
  isBoolean("") // Returns false
  isBoolean("false") // Returns true, instead of false
  isBoolean("asd") // Returns true, instead of false
  </code></pre>
  
  <p>It only seems to work with "1" and "0" values:</p>
  
  <pre><code>isBoolean("1") // Returns true
  isBoolean("0") // Returns false
  </code></pre>
  
  <p>Is there a native function in PHP to parse "true" and "false" strings into boolean?</p>