Код: Выделить всё
public function rusDate($date)
{
$date = (string) $date;
$day = substr($date, 8, 2);
$year = substr($date, 0, 4);
$month = substr($date, 5, 2);
$month = (int) $month;
$month_name = array (
' неизвестного месяца ',
' января ',
' февраля ',
' марта ',
' апреля ',
' мая ',
' июня ',
' июля ',
' августа ',
' сентября ',
' октября ',
' ноября ',
' декабря ',
);
$date_new = $day.$month_name[$month].$year.' г.';
return $date_new;
}