note 52131 added to function.rand
| From: | jawsper at osu1 dot php dot net | Date: | Thu, 21 Apr 2005 19:33:28 +0000 |
| Subject: | note 52131 added to function.rand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88371@lists.php.net to get a copy of this message | ||
why so complicated?
this works fine for me:
<?php
function randomstring($length) {
$random = rand();
$string = md5($random);
$output = substr($string,$length);
return $output;
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.rand.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52131
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52131&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52131&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52131&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52131&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52131&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52131&report=yes
Search -- http://master.php.net/manage/user-notes.php