note 68357 deleted from function.rand by felipe

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: axe at (opposite of old) dot co za 

----

A simple snippet of code that generates a random number with exceptions.

<?php

function numberGen() {

function research() {
echo "Search Over";
$seed = make_seed();
$check = check_num($seed);
}

function make_seed()
{
   $seed = rand(0, 10);
   return $seed;
}////////////////////////////

function check_num($value) {
$comparison[0] = 0;
$comparison[1] = 1;
$comparison[2] = 2;
$comparison[3] = 3;
$comparison[4] = 4;
$comparison[5] = 5;
$comparison[6] = 6;
$comparison[7] = 8;
$comparison[8] = 9;
$comparison[10] = 10;

if($value != $comparison[5]) {
echo "$value";
} else {
echo "Researching";
research();
}

}////////////////////////////

$seed_start = make_seed();
$check_start = check_num($seed_start);

}
numberGen();
?>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.