Yangi formatda davom etish uchun: https://uzfor.net/view.php?act=post&id=83553
Postga havola
DjHuSo [843] [off]
<?php function sanash($number) { 1=> 'bir', 2=> 'ikki', 3=> 'uch', 4=> 'to\'rt', 5=> 'besh', 6=> 'olti', 7=> 'yetti', 8=> 'sakkiz', 9=> 'to\'qqiz', 10=> 'o\'n', 11=> 'o\'nbir', 12=> 'o\'nikki', 13=> 'o\'nuch', 14=> 'o\'nto\'rt' , 15=> 'o\'nbesh', 16=> 'o\'nolti', 17=> 'o\'nyetti', 18=> 'o\'nsakkiz', 19=> 'o\'nto\'qiz', 20=> 'yigirma', 30=> 'o\'ttiz', 40=> 'qirq', 50=> 'elik', 60=> 'oltmish', 70=> 'yetmish', 80=> 'sakson', 90=> 'qo\'qson', 100=> 'yuz', 200=> 'ikkiyuz', 300=> 'uchyuz', 400=> 'to\'tyuz', 500=> 'beshyuz', 600=> 'oltiyuz', 700=> 'yrttiyuz', 800=> 'sakkizyuz', 900=> 'to\'qizyuz' ), ); foreach($parts as $i=>$part) { if($part>0) { if($part>99) { } if($mod1=$part%100) { $mod2 = $part%10; $flag = $i==1 && $mod1!=11 && $mod1!=12 && $mod2<3 ? -1 : 1; if($mod1<20 || !$mod2) { $digits[] = $flag*$mod1; } else { $digits[] = $flag*$mod2; } } foreach($digits as $j=>$digit) { $digits[$j] = $dic[0][$digit]; } } } } sanash(25); $sanoq = $_POST['sonlar']; echo'<b>'.$sanoq.'</b> - '; echo sanash($sanoq); } echo'<form name="form" action="" method="POST"> Sanaladigan sonni yozing:<br> <input type="number" name="sonlar" required><br> <input name="sanash" type="submit" value="Sanash"> </form>'; ?>