Created
March 9, 2012 12:18
-
-
Save Znarkus/2006296 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$nummer=$_POST['nummer']; | |
// hämtar inmatat värde från första sidan | |
$under50 = array(); | |
$over50 = array(); | |
if (is_numeric($nummer)) | |
{ | |
for($x=1 ; $x <=$nummer; $x++) | |
{ | |
$rand = rand(0, 100); | |
echo ' ' . $rand . '<br/>'; | |
if ($rand < 50) { | |
$under50[] = $rand; | |
} else { | |
$over50[] = $rand; | |
} | |
} | |
} else { | |
echo "Skärp dig, skriv ett numeriskt värde mellan 1-100."; | |
} | |
echo '<br/>< 50<br/>'; | |
foreach ($under50 as $v) { | |
echo "{$v}<br/>"; | |
} | |
echo '<br/>>= 50<br/>'; | |
foreach ($over50 as $v) { | |
echo "{$v}<br/>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment