note 96583 added to function.rand
| From: | Anonymous at osu1 dot php dot net | Date: | Sat, 06 Mar 2010 02:41:06 +0000 |
| Subject: | note 96583 added to function.rand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-166727@lists.php.net to get a copy of this message | ||
Generate a random 5 character A-Z0-9 string
for ($i=0; $i<6; $i++) {
$d=rand(1,30)%2;
echo $d ? chr(rand(65,90)) : chr(rand(48,57));
}
# php -r 'for ($i=0; $i<6; $i++) { $d=rand(1,30)%2; echo $d ? chr(rand(65,90)) :
chr(rand(48,57)); } echo "\n";'
14BW1A
----
Server IP: 69.147.83.197
Probable Submitter: 75.74.114.197
----
Manual Page -- http://www.php.net/manual/en/function.rand.php
Edit -- https://master.php.net/note/edit/96583
Del: integrated -- https://master.php.net/note/delete/96583/integrated
Del: useless -- https://master.php.net/note/delete/96583/useless
Del: bad code -- https://master.php.net/note/delete/96583/bad+code
Del: spam -- https://master.php.net/note/delete/96583/spam
Del: non-english -- https://master.php.net/note/delete/96583/non-english
Del: in docs -- https://master.php.net/note/delete/96583/in+docs
Del: other reasons-- https://master.php.net/note/delete/96583
Reject -- https://master.php.net/note/reject/96583
Search -- https://master.php.net/manage/user-notes.php