Sadik B Well-known member Jun 5, 2018 #1 What are all the possible characters which generateRandomString() can return? Can it contain special characters other than _- Thanks
What are all the possible characters which generateRandomString() can return? Can it contain special characters other than _- Thanks
S S Thomas Well-known member Jun 5, 2018 #2 PHP: public static function getRandomString($length) { $random = self::getRandomBytes($length); $string = strtr(base64_encode($random), [ '=' => '', "\r" => '', "\n" => '', '+' => '-', '/' => '_' ]); return substr($string, 0, $length); } nope.
PHP: public static function getRandomString($length) { $random = self::getRandomBytes($length); $string = strtr(base64_encode($random), [ '=' => '', "\r" => '', "\n" => '', '+' => '-', '/' => '_' ]); return substr($string, 0, $length); } nope.