Dizi Kullanımı
Forma girilen 12/10/2007 şeklindeki metni yazıya çeviren uygulama
Forma girilen Onbeş/Aralık/2007 şeklindeki metni sayıya çeviren uygulama
<html>
<body>
<?php
if($_POST['sayi']){
$gun=array("sifir","Bir","Iki","Uc","Dort","Bes","Alti","Yedi","Sekiz","Dokuz","On","Onbir","Oniki","Onüç");
$ay=array("sıfır","Ocak","Subat","Mart","Nisan","Mayis","Haziran","Temmuz","Agustos","Eylul","Ekim","Kasim","Aralik");
echo $gun[$_POST['sayi']] ;
echo $ay[$_POST['sayi2']] ;
echo $_POST['sayi3'];
}
?>
<form method="post">
<input name="sayi" type="text" size="5" maxlength="2" />
/
<input name="sayi2" type="text" size="5" maxlength="2" />
/
<input name="sayi3" type="text" size="7" maxlength="4" />
<input type="submit" name="gonder" value="Gönder" />
</body>
</html>
<body>
<?php
if($_POST['sayi']){
$gun=array("sifir","Bir","Iki","Uc","Dort","Bes","Alti","Yedi","Sekiz","Dokuz","On","Onbir","Oniki","Onüç");
$ay=array("sıfır","Ocak","Subat","Mart","Nisan","Mayis","Haziran","Temmuz","Agustos","Eylul","Ekim","Kasim","Aralik");
echo $gun[$_POST['sayi']] ;
echo $ay[$_POST['sayi2']] ;
echo $_POST['sayi3'];
}
?>
<form method="post">
<input name="sayi" type="text" size="5" maxlength="2" />
/
<input name="sayi2" type="text" size="5" maxlength="2" />
/
<input name="sayi3" type="text" size="7" maxlength="4" />
<input type="submit" name="gonder" value="Gönder" />
</body>
</html>
Forma girilen Onbeş/Aralık/2007 şeklindeki metni sayıya çeviren uygulama
<html>
<body>
<?php
if(!empty($_POST['gun'])){
$gun=array(sifir=>0,bir=>1,iki=>2,uc,4,"5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31");
$ay=array(Ocak=>1,subat=>2,mart=>3);
echo $gun[$_POST['gun']];
echo $ay[$_POST['ay']];
echo $_POST['yil'];
}
?>
<form method="post">
<input type="text" name="gun" size="5">/
<input type="text" name="ay" size="5">/
<input type="text" name="yil" size="8">
<input type="submit" value="Gonder" />
</form>
</body>
</html>
<body>
<?php
if(!empty($_POST['gun'])){
$gun=array(sifir=>0,bir=>1,iki=>2,uc,4,"5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31");
$ay=array(Ocak=>1,subat=>2,mart=>3);
echo $gun[$_POST['gun']];
echo $ay[$_POST['ay']];
echo $_POST['yil'];
}
?>
<form method="post">
<input type="text" name="gun" size="5">/
<input type="text" name="ay" size="5">/
<input type="text" name="yil" size="8">
<input type="submit" value="Gonder" />
</form>
</body>
</html>
Yorumunuzu Ekleyin