fork(13) download
  1. <?php
  2.  
  3. // PHP Arabic Date
  4.  
  5. error_reporting(E_ALL ^ E_NOTICE);
  6.  
  7. $months = array(
  8. "Jan" => "يناير",
  9. "Feb" => "فبراير",
  10. "Mar" => "مارس",
  11. "Apr" => "أبريل",
  12. "May" => "مايو",
  13. "Jun" => "يونيو",
  14. "Jul" => "يوليو",
  15. "Aug" => "أغسطس",
  16. "Sep" => "سبتمبر",
  17. "Oct" => "أكتوبر",
  18. "Nov" => "نوفمبر",
  19. "Dec" => "ديسمبر"
  20. );
  21.  
  22. $your_date = date('y-m-d'); // The Current Date
  23.  
  24. $en_month = date("M", strtotime($your_date));
  25.  
  26. foreach ($months as $en => $ar) {
  27. if ($en == $en_month) {
  28. $ar_month = $ar;
  29. }
  30. }
  31.  
  32. $find = array (
  33.  
  34. "Sat",
  35. "Sun",
  36. "Mon",
  37. "Tue",
  38. "Wed" ,
  39. "Thu",
  40. "Fri"
  41.  
  42. );
  43.  
  44. $replace = array (
  45.  
  46. "السبت",
  47. "الأحد",
  48. "الإثنين",
  49. "الثلاثاء",
  50. "الأربعاء",
  51. "الخميس",
  52. "الجمعة"
  53.  
  54. );
  55.  
  56. $ar_day_format = date('D'); // The Current Day
  57.  
  58. $ar_day = str_replace($find, $replace, $ar_day_format);
  59.  
  60.  
  61. header('Content-Type: text/html; charset=utf-8');
  62. $standard = array("0","1","2","3","4","5","6","7","8","9");
  63. $eastern_arabic_symbols = array("٠","١","٢","٣","٤","٥","٦","٧","٨","٩");
  64. $current_date = $ar_day.' '.date('d').' / '.$ar_month.' / '.date('Y');
  65. $arabic_date = str_replace($standard , $eastern_arabic_symbols , $current_date);
  66.  
  67. // Echo Out the Date
  68. echo $arabic_date;
  69.  
  70. ?>
Success #stdin #stdout 0.02s 24448KB
stdin
Standard input is empty
stdout
الخميس ٢٨ / مايو / ٢٠١٥