This is the string "2/29/16" i want to use this to compute dates can you suggest a way to use this string as a date?
$string = '2/29/16';
$date = new DateTime($string);
echo $date->format('Y-m-d');
The output is
2016-02-29
On how to format a date object, read in the PHP manual
To format the today string:
$date = new DateTime();
echo $date->format('Y-m-d');
Result:
2016-02-26