note 86281 added to function.rand

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
A function to generate numbers of any length which contain  no identical digits side-by-side. i.e. 112233

function randomNumber($number_of_digits=null){
	for($x=0;$x<$number_of_digits;$x++){
		while(substr($num,strlen($num)-1,strlen($num)) == $r) $r = rand(0,9); 
		$new_number .= $r;
	}
	return $new_number;
}

echo randomNumber(9);

// Output: 875438104
----
Server IP: 69.147.83.197
Probable Submitter: 72.216.6.122
----
Manual Page -- http://www.php.net/manual/en/function.rand.php
Edit        -- https://master.php.net/note/edit/86281
Del: integrated  -- https://master.php.net/note/delete/86281/integrated
Del: useless     -- https://master.php.net/note/delete/86281/useless
Del: bad code    -- https://master.php.net/note/delete/86281/bad+code
Del: spam        -- https://master.php.net/note/delete/86281/spam
Del: non-english -- https://master.php.net/note/delete/86281/non-english
Del: in docs     -- https://master.php.net/note/delete/86281/in+docs
Del: other reasons-- https://master.php.net/note/delete/86281
Reject      -- https://master.php.net/note/reject/86281
Search      -- https://master.php.net/manage/user-notes.php
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.