- var_dump: documentation ( source)
- bin2hex: documentation ( source)
- uniqid: documentation ( source)
- mt_rand: documentation ( source)
<?php
$token = uniqid('', true);
var_dump($token);
$token = uniqid(mt_rand(), true);
var_dump($token);
$bytes = openssl_random_pseudo_bytes(4);
$hex = bin2hex($bytes);
var_dump($bytes);
var_dump($hex);