Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Kenan-Amran's avatar

Date

Hello How can use this function to convert date after insert database from( 2016-10-15 08:09:00 - TO - أكتوبر 16 2016)

public static function getArabicMonth($data) { $months = [ "Jan" => "يناير", "Feb" => "فبراير", "Mar" => "مارس", "Apr" => "أبريل", "May" => "مايو", "Jun" => "يونيو", "Jul" => "يوليو", "Aug" => "أغسطس", "Sep" => "سبتمبر", "Oct" => "أكتوبر", "Nov" => "نوفمبر", "Dec" => "ديسمبر" ];

$day = date("d", strtotime($data));
$month = date("M", strtotime($data));
$year = date("Y", strtotime($data));

$month = $months[$month];

return $day . ' ' . $month . ' ' . $year;

}

0 likes
0 replies

Please or to participate in this conversation.