ConvertFinglishToFarsi.php
/**
	 * ConvertFinglishToFarsi::replaceWithFarsiNumbers
	 *
	 * Replaces english numbers with persian numbers
	 *
	 * @param $text string Text containing english numbers
	 * @return string Text with converted numbers
     */


Replaces english numbers with persian numbers

@param $text string Text containing english numbers
@return string Text with converted numbers
Replaces english numbers with persian numbers @param $text string Text containing english numbers @return string Text with converted numbers
private function replaceWithFarsiNumbers($text)
    {
        $farsi_array = array("۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹");
        $english_array = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
        return str_replace($english_array, $farsi_array, $text);
    }
private function replaceWithFarsiNumbers ( $ text ) { $ farsi_array = array ( " ۰" , ۱ ", " " ,  " ۳ ,  " ۴ " "۵ " , " ۶" , ۷ ", " " ,  " ۹ ) ;
 $ english_array = array ( " 0 " , " 1 " , " 2 " , " 3 " , " 4 " , " 5 " , " 6 " , " 7 " , " 8 " , " 9 " ) ; return str_replace ( $ english_array , $ farsi_array , $ text ) ; }
ConvertFinglishToFarsi::replaceWithFarsiNumbers
ConvertFinglishToFarsi :: replaceWithFarsiNumbers