1

Possible Duplicate:
Convert numeral date(03-11-1991) into arabic no(۱۹۹۱/۱۱/۰۳) php

This is my client's requirement. He want to show Today's date in Normal numbers and below that in Arabic numbers too. see this screen shot

I can get the current date easily by the following code snippet :

$current_date = date('d').'-'.date('m').'-'.date('Y');

but how could i convert the numbers to Arabic numbers and display them.? Please advice good methods to do this.

Community
  • 1
  • 1
Jithesh Kt
  • 2,023
  • 6
  • 32
  • 48

1 Answers1

4

check this uk.php.net/manual/en/class.intldateformatter.php or you can use the below string replace function

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 = date('d').'-'.date('m').'-'.date('Y');
$arabic_date = str_replace($standard , $eastern_arabic_symbols , $current_date);
arun
  • 3,667
  • 3
  • 29
  • 54