<link href="style.css" rel="stylesheet" type="text/css">
<form method="POST">
0-1.000.000 Ft ig adja meg az értéket!<br>
<input type=text name=osszeg><input type=submit name=submit value=Váltás!>
<br>
</form>
<?php
error_reporting(E_ALL ^ E_NOTICE);
$x = 0;
if (isset($_POST[\'osszeg\'])) {$x=$_POST[\'osszeg\'];}
$const=1000000;
if ($x != NULL){ // if(!empty($x)){ // if(!isset($x)){
print("Az összeg: $x").("<br>").("<br>");
$tomb=array ("20000",
"10000",
"5000",
"2000",
"1000",
"500",
"200",
"100",
"50",
"20",
"10",
"5",
"2",
"1");
$y = count($tomb);
if ($x <= $const)
{
for ($i=0; $i<=$y; $i++)
{
print(("Ennyi ").("$tomb[0] Ft-os kell: ").(int)($x/$tomb[0])).("<br>");
$x=$x%$tomb[0];
$tomb[0]=$tomb[$i];
}
}
else{
print("<hr>").("Írjon be 0 és $const közötti számot!");
}
}
?>