title: Fatal error: Cannot redeclare calculateAge() previously declared
body: <p>I am trying to calculate the age but I am getting this error </p>
  
  <blockquote>
    <p>Fatal error: Cannot redeclare calculateAge() (previously declared</p>
  </blockquote>
  
  <hr>
  
  <pre><code>    $age = $row3['DBirth'];
  
      function calculateAge($date)
     {
      list($year,$month,$day) = explode("-",$date);
  
      $year_diff  = date("Y") - $year;
  
      $month_diff = date("m") - $month;
  
      $day_diff   = date("d") - $day;
  
      if ($day_diff &lt; 0 || $month_diff &lt; 0) $year_diff--;
  
        return $year_diff;
  
    }
  
    echo 'Student age is'.calculateAge($age).' years old';
  </code></pre>
  
  <p>Any idea ?
  Thanks,</p>