<html> <body> <form action="deneme.php" method="get"> sayi: <input type="text" name="sayi" /> </br> <input type="submit" /> </form> <?php $yaz=($_REQUEST['sayi']) ; if ( ($yaz<1) || ($yaz>99) ) { echo $yaz="Lütfen 1 ile 99 arasinda bir deger giriniz"; } else $on = array(" ", "10"=>on, "20"=>yirmi, "30"=>otuz, "40"=>kirk, "50"=>elli, "60"=>altmis, "70"=>yetmis, "80"=>seksen, "90"=>doksan); $bir = array(" ", "1"=>bir, "2"=>iki, "3"=>uc, "4"=>dort, "5"=>bes, "6"=>alti, "7"=>yedi, "8"=>sekiz, "9"=>dokuz); $son=substr($on[$yaz],0,10); echo $son; ?> </body> </html> Code (markup): "$on + $bir " These variables don't together.For example don't write as "88","99","11". What I do to run this program?
I really don't understand your question, but I see something wrong in your code that might be causing the problem. You have to add curly brackets to the else for multiple statements. else { $on = array(" ", "10"=>"on", "20"=>"yirmi", "30"=>"otuz", "40"=>"kirk", "50"=>"elli", "60"=>"altmis", "70"=>"yetmis", "80"=>"seksen", "90"=>"doksan"); $bir = array(" ", "1"=>bir, "2"=>iki, "3"=>uc, "4"=>dort, "5"=>bes, "6"=>alti, "7"=>yedi, "8"=>sekiz, "9"=>dokuz); $son=substr($on[$yaz],0,10); echo $son; } PHP: And strings have to go between quotes. PHP will consider them constants first otherwise, and leave notices.
This program already running.But I wanted two variable "$on and $bir" together to read on screen. The program wouldn't you when write "88".
Al arkadaÅŸ $on = array(0=>'', 1=>'on', 2=>'yirmi', 3=>'otuz', 4=>'kirk', 5=>'elli', 6=>'altmis', 7=>'yetmis', 8=>'seksen', 9=>'doksan'); $bir = array(0=>'', 1=>'bir', 2=>'iki', 3=>'uc', 4=>'dort', 5->'bes', 6=>'alti', 7=>'yedi', 8=>'sekiz', 9=>'dokuz'); $son = $on[(int)($yaz/10)] . ' ' . $bir[$yaz-(int)($yaz/10)*10]; echo $son; PHP: