title: PHP - function name($variable = FALSE) - purpose of FALSE declaration - example from Codeigniter
body: <p>This is probably quite a simply question but it's something I have never come across until recently.</p>
  
  <p>I was beginning to research PHP frameworks and delved into the tutorial on Codeigniter.</p>
  
  <p>When building the dynamic news section pages, the following method is defined:</p>
  
  <pre><code>public function get_news($slug = FALSE) {
  </code></pre>
  
  <p>in <code>news_model.php</code>. The method then goes on to check if <code>($slug === FALSE)</code> to return all the database rows or, if not, get the new item corresponding to the passed <code>$slug</code>.</p>
  
  <p>Can someone tell me what <code>($slug = FALSE)</code> does when defining the method? Excluding it returns a missing argument warning.</p>
  
  <p>The full method is:</p>
  
  <pre><code>public function get_news($slug) {
      if ($slug === FALSE) {
          $query = $this-&gt;db-&gt;get('news');
          return $query-&gt;result_array();
      }
  
      $query = $this-&gt;db-&gt;get_where('news', array('slug' =&gt; $slug));
      return $query-&gt;row_array();
  }
  </code></pre>
  
  <p>I realise that this isn't going to be specific to Codeigniter but I thought I'd use the example in the CI tutorial to explain my confusion.</p>
  
  <p>Thanks.</p>