Answers for "generate a starting string followed by a random number in php"

PHP
6

php random string

function rand_str() {
    $characters = '0123456789-=+{}[]:;@#~.?/>,<|\!"£$%^&*()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $randomstr = '';
    for ($i = 0; $i < random_int(50, 100); $i++) {
      $randomstr .= $characters[rand(0, strlen($characters) - 1)];
    }
    return $randomstr;
  }
Posted by: Guest on October-03-2020
0

Generate Random String in PHP

phpCopy<?php 
echo uniqid('user_');
?>
Posted by: Guest on April-23-2021

Code answers related to "generate a starting string followed by a random number in php"

Browse Popular Code Answers by Language