Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Here you can print the Arabic PHP Date :</strong></p> <p>Create a file called <code>arabicdate.php</code> and place this function inside it :</p> <pre><code>function ArabicDate() { $months = array("Jan" =&gt; "يناير", "Feb" =&gt; "فبراير", "Mar" =&gt; "مارس", "Apr" =&gt; "أبريل", "May" =&gt; "مايو", "Jun" =&gt; "يونيو", "Jul" =&gt; "يوليو", "Aug" =&gt; "أغسطس", "Sep" =&gt; "سبتمبر", "Oct" =&gt; "أكتوبر", "Nov" =&gt; "نوفمبر", "Dec" =&gt; "ديسمبر"); $your_date = date('y-m-d'); // The Current Date $en_month = date("M", strtotime($your_date)); foreach ($months as $en =&gt; $ar) { if ($en == $en_month) { $ar_month = $ar; } } $find = array ("Sat", "Sun", "Mon", "Tue", "Wed" , "Thu", "Fri"); $replace = array ("السبت", "الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة"); $ar_day_format = date('D'); // The Current Day $ar_day = str_replace($find, $replace, $ar_day_format); header('Content-Type: text/html; charset=utf-8'); $standard = array("0","1","2","3","4","5","6","7","8","9"); $eastern_arabic_symbols = array("٠","١","٢","٣","٤","٥","٦","٧","٨","٩"); $current_date = $ar_day.' '.date('d').' / '.$ar_month.' / '.date('Y'); $arabic_date = str_replace($standard , $eastern_arabic_symbols , $current_date); return $arabic_date; } </code></pre> <p>Now include this file in your page :</p> <pre><code>include 'arabicdate.php'; </code></pre> <p><strong>Then you can print the Arabic PHP Date :</strong></p> <pre><code>echo ArabicDate(); </code></pre> <p><strong>Live Formatted Example :</strong></p> <p><a href="http://ideone.com/MC0hou" rel="noreferrer">http://ideone.com/MC0hou</a></p> <p>Hope that helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload