Home  |  Linux  | Mysql  | PHP  | XML
From:tularis@php.net Date:Mon Oct  6 08:47:46 2008
Subject:note 86163 deleted from function.rand by tularis
Note Submitter: niepamietamnazwy at gmail dot com 

----

for Random string...

<?php

function random_string($numofletters) {
  $v="";
  for($i=0;$i<$numofletters;$i++){
   if(rand(0,1)==1) {$v.=chr(rand(65,90));}
   else {$v.=rand(0,9);}
  }
  return $v;
}

?>

hope it help.
Navigate in group php.notes at sever news.php.net
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by Zareef Ahmed
Powered By PHP Consultants