- explode: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$rec['birthday']= "03/11";
$date = explode('-', $rec['birthday']);
if($date[2] == '')
{
$birthday = $date[0].'-'.$date[1].'-'.'0000';
}
else{
$birthday = date('Y-m-d', strtotime($rec['birthday']));
}
echo $birthday;
?>