Created
November 6, 2018 13:23
-
-
Save alisalmabadi/165b7ee7fd6d5f3cc1453fe3f0f57feb to your computer and use it in GitHub Desktop.
this function can convert all English numbers to Persian
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Convertnumber2persian($srting) { | |
$srting = str_replace('0','۰', $srting); | |
$srting = str_replace('1','۱', $srting); | |
$srting = str_replace('2','۲', $srting); | |
$srting = str_replace('3','۳', $srting); | |
$srting = str_replace('4','۴', $srting); | |
$srting = str_replace('5','۵', $srting); | |
$srting = str_replace('6','۶', $srting); | |
$srting = str_replace('7','۷', $srting); | |
$srting = str_replace('8','۸', $srting); | |
$srting = str_replace('9','۹', $srting); | |
return $srting; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment