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

Related questions

1 answer 217 views
217 views asked Oct 2, 2021 by avibootz
1 answer 199 views
199 views asked Sep 23, 2023 by avibootz
1 answer 247 views
...