1//generates 13 character random unique alphanumeric id
2echo uniqid();
3//output - 5e6d873a4f597
1function rand_str() {
2 $characters = '0123456789-=+{}[]:;@#~.?/>,<|\!"£$%^&*()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
3 $randomstr = '';
4 for ($i = 0; $i < random_int(50, 100); $i++) {
5 $randomstr .= $characters[rand(0, strlen($characters) - 1)];
6 }
7 return $randomstr;
8 }