Navigation :

Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Blog
Books
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links




Site Sponsors :

Bookmark :

Links :

gambling sites
dropshippers
programmershelp

Downloads :

Misc :

Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming

Valid XHTML 1.0 Transitional


Valid CSS!


Random string

generates a random string from an array of characters

<?php
// function to generate random strings
function RandomString($length=32)
{
$randstr='';
srand((double)microtime()*1000000);
//our array add all letters and numbers if you wish
$chars = array ( 'a','b','c','d','e','f');
for ($rand = 0; $rand <= $length; $rand++)
{
$random = rand(0, count($chars) -1);
$randstr .= $chars[$random];
}
return $randstr;
}
?>

and call it like this


<?php
echo RandomString(8);
?>