function dateFormat ret explode datetoday date Y-m-D if datetoday time

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
function dateFormat($a)
{
$ret = ''
$a = explode(" ", $a);
$datetoday = date("Y-m-D");
if($a[0] == $datetoday)
{
$time = explode(":", $a[1]);
$time = $time[0].":".$time[1];
$ret = "$time, сегодня";
}
else
{
$ret = "sdfsdfsf";
}
return $ret;
}