note 96108 deleted from control-structures.switch by thiago
| From: | thiago@php.net | Date: | Tue, 09 Feb 2010 12:10:38 +0000 |
| Subject: | note 96108 deleted from control-structures.switch by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-165787@lists.php.net to get a copy of this message | ||
Note Submitter: 96352 at rsglingecollege dot nl
Reason: non-english
----
Versienummer
<html>
<head>
<title>Opdracht 6.5 - PHP versie.</title>
</head>
<body>
<?php echo phpversion(); ?>
</body>
</html>
De postcodeloterij.
<html>
<head>
<title>Opdracht 6.6 - De postcodeloterij.</title>
<?php
function trek()
{
srand();
$cijfers=rand(1000,9999);
$letter1=chr(64+rand(1,26));
$letter2=chr(64+rand(1,26));
return $cijfers." ".$letter1.$letter2;
}
?>
</head>
<body>
<?php echo "<h3>De winnende postcode is: ".trek()." </h3>"; ?>
</body>
</html>
Koers dollar
<html>
<head>
<title>Opdracht 6.7 - Van dollars naar euro's.</title>
<?php
$koers=1.51332;
function dollar2euro($a)
{
global $koers;
return round($a/$koers,2);
}
?>
</head>
<body>
<?php echo "<h3>\$ 86.74 is ⬠".dollar2euro(86.74)." bij een koers van
$koers</h3>"; ?>
</body>
</html>
Een wachtwoordgenerator.
<html>
<head>
<title>Opdracht 6.8 - Een wachtwoordgenerator.</title>
<?php
function ww()
{
srand();
$digit=array(
'A','B',...,'Z',
'a','b',...,'z',
'0',...,'+');
$code="";
for ($i=1;$i<=8;$i++)
$code .=$digit[rand(0,73)];
return $code;
}
?>
</head>
<body>
<?php
for ($i=1;$i<=5;$i++)
echo "wachtwoord $i : <b>".ww()."</b><br>"; ?>
</body>
</html>