1<?php
2
3// Thanks to: https://thisinterestsme.com/generating-random-token-php/
4
5//Generate a random string.
6$token = openssl_random_pseudo_bytes(16);
7
8//Convert the binary data into hexadecimal representation.
9$token = bin2hex($token);
10
11//Print it out for example purposes.
12echo $token;
13
14?>
1<?php
2
3//Generate a random string.
4$token = openssl_random_pseudo_bytes(16);
5
6//Convert the binary data into hexadecimal representation.
7$token = bin2hex($token);
8
9//Print it out for example purposes.
10echo $token;
11?>