- substr: documentation ( source)
- var_dump: documentation ( source)
- strpos: documentation ( source)
<?php
$string = "blah 2015 yar";
$pos = strpos($string, "20");
$year = substr($string, $pos, 4);
echo $year . "<br />\n";
$end_year = "12/31/" . $year;
$end_time = new DateTime($end_year);
$start_time = new DateTime();
$diff = $end_time ->diff($start_time);
var_dump($diff);
?>