title: What causes "undefined function" date_diff?
body: <p>i have this script which i'm using in my php to convert a users date of birth to their age.
  It works fine on my local host but when i upload it to the server the page comes up with this error:</p>
  
  <blockquote>
    <p>Fatal error: <strong>Call to undefined function date_diff()</strong> in /home/content/31/9118831/html/projects/mark.ptb/PTB1/includes/mod_home/mod_platinum.php on line 19</p>
  </blockquote>
  
  <p>Here's my code, i'm guessing i've not defined the function although i can't understand why it would work fine on my localhost therefore?</p>
  
  <pre><code>&lt;?php
   $dob = $platinum['dob'];
  
  function age_from_dob($dob) {
  
  
         $age = date_diff(date_create($dob), date_create('now'))-&gt;y;  
         return $age;
  }
  
  ?&gt;
  
  &lt;?
  
          $platinum_set = get_platinum_users();
          while ($platinum = mysql_fetch_array($platinum_set)) {
          $age = age_from_dob($platinum['dob']);
               echo "
              &lt;div class=\"platinumcase\"&gt;
              &lt;a href=\"profile.php?id={$platinum['id']}\"&gt;&lt;img width=80px height= 80px src=\"data/photos/{$platinum['id']}/_default.jpg\" class=\"boxgrid\"/&gt;&lt;/a&gt;&lt;h58&gt; {$platinum['first_name']} {$platinum['last_name']}&lt;/h58&gt;&lt;br/&gt;&lt;br/&gt;&lt;h52&gt; ".$age." Years Old&lt;br/&gt;&lt;br/&gt;From {$platinum['location']}&lt;/h52&gt;
  
              &lt;/div&gt;";
          }
      ?&gt;
  </code></pre>