note 87752 added to function.rand

From: Date: Fri, 19 Dec 2008 14:07:50 +0000
Subject: note 87752 added to function.rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-148348@lists.php.net to get a copy of this message
Easy way to create randomized passwords. 34 is the number of letters/numbers. You can also add special characters. If you do so, change 34 to number of characters (first char is 0) $a = 'abcdefghijklmnopqrstuvwxyz123456789'; $password = $a[rand(0,34)].$a[rand(0,34)]. $a[rand(0,34)].$a[rand(0,34)].$a[rand(0,34)]. $a[rand(0,34)].$a[rand(0,34)].$a[rand(0,34)]; echo $password; ---- Server IP: 212.63.193.10 Probable Submitter: 90.227.109.40 ---- Manual Page -- http://www.php.net/manual/en/function.rand.php Edit -- https://master.php.net/note/edit/87752 Del: integrated -- https://master.php.net/note/delete/87752/integrated Del: useless -- https://master.php.net/note/delete/87752/useless Del: bad code -- https://master.php.net/note/delete/87752/bad+code Del: spam -- https://master.php.net/note/delete/87752/spam Del: non-english -- https://master.php.net/note/delete/87752/non-english Del: in docs -- https://master.php.net/note/delete/87752/in+docs Del: other reasons-- https://master.php.net/note/delete/87752 Reject -- https://master.php.net/note/reject/87752 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#148348) next »