note 57592 deleted from function.rand by nlopess

From: Date: Sat, 24 Nov 2007 11:28:43 +0000
Subject: note 57592 deleted from function.rand by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-132527@lists.php.net to get a copy of this message
Note Submitter: expertphp at yahoo dot com ---- Generate custom random characters. By default, allwed characters are [0-9][a-z][A-Z]. Optional, you can generate only with numeric or/and not numeric characters. For more informations, please visit: http://expert.no-ip.org/?free=Random&class <?php require_once 'Random.php'; // generate 3 default random characters $obj1 = new Random; echo $obj1->get(3)."<br />\n"; // generate 4 custom [abcdefgh] random characters $obj2 = new Random("abcdefgh"); echo $obj2->get(4)."<br />\n"; // generate 6 default random characters // with only numeric and not numeric character(s) // this option is useful to generate a custom password $obj3 = new Random(false, true, true); echo $obj3->get(6)."<br />\n"; // generate another 12 random characters with $obj3 options echo $obj3->get(12); ?> Output results : 0x9 ebgc aBAB0d 5X6Sfo0Cui6J

« previous php.notes (#132527) next »