How to generate a short unique ID in PHP

2 Answers

0 votes
$short_unique_id = uniqid();

echo $short_unique_id;





/*
run:

656aedef934c0

*/

 



answered Dec 2, 2023 by avibootz
0 votes
$prefix = 'vq_';

$short_unique_id = $prefix.uniqid();

echo $short_unique_id;





/*
run:

vq_656aeeb10ed33

*/

 



answered Dec 2, 2023 by avibootz
...