Skip to content

Instantly share code, notes, and snippets.

@nootanghimire
Created November 7, 2013 06:45
Show Gist options
  • Save nootanghimire/7350133 to your computer and use it in GitHub Desktop.
Save nootanghimire/7350133 to your computer and use it in GitHub Desktop.
Converts numbers into nepali
<?php
function convert($num){
$arr = array(०,१,२,३,४,५,६,७,८,९);
$newArr = array();
$sep = str_split($num); //implicit string conversion
foreach($sep as $key=>$value){
$newArr[$key] = $arr[$value];
}
return implode('',$newArr);
}
echo convert(120);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment