Rss Feed
  1. Php to generate random numbers!!

    Thursday, 1 November 2012



    Random string generation

      function generateRandomString($length = 10) { // to generate rendom strings
        $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $randomString = '';
        for ($i = 0; $i < $length; $i++) {
            $randomString .= $characters[rand(0, strlen($characters) - 1)];
        }
        return $randomString;
        //refer :http://stackoverflow.com/questions/4356289/php-random-string-generator
    }

  2. 0 comments:

    Post a Comment