Welcome Guest, Not a member yet? Register   Sign In
string helper
#7

[eluser]mr daniel[/eluser]
So I tried to create
Code:
switch ($type)
     {
      case 'alpha' : $pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
       break;
      case 'alnum' : $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
       break;
      case 'numeric' : $pool = '0123456789';
       break;
      case 'nozero' : $pool = '123456789';
       break;
      case 'fourlet' : $pool = array('my', 'fun', 'zone', '12', '24', '37');
       break;
     }

     $str = '';
     for ($i=0; $i < $len; $i++)
     {
      $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1);
     }
     return $str;


and also attempted it using the code you provided yet it still failed Sad I'll keep attempting


Messages In This Thread
string helper - by El Forum - 07-16-2012, 05:46 PM
string helper - by El Forum - 07-16-2012, 07:01 PM
string helper - by El Forum - 07-16-2012, 07:03 PM
string helper - by El Forum - 07-16-2012, 07:11 PM
string helper - by El Forum - 07-16-2012, 07:44 PM
string helper - by El Forum - 07-16-2012, 08:56 PM
string helper - by El Forum - 07-16-2012, 09:44 PM
string helper - by El Forum - 07-16-2012, 10:02 PM
string helper - by El Forum - 07-16-2012, 10:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB