In code
Generate a UUID in PHP
The ramsey/uuid package is the standard choice.
PHP example
PHP
// composer require ramsey/uuid
use Ramsey\Uuid\Uuid;
echo Uuid::uuid4()->toString();
No install? Use the tool or API
Here's a fresh version 4 UUID generated right now — copy it, or call the API from any language.
a5d8c53a-2cbd-49c5-9087-6b7024286957
curl https://getuuid.sh/api/uuid