ramsey/uuid library
- Add
ramsey/uuid
library tocomposer.json
file:
"require": {
"ramsey/uuid": "^4.2"
}
- Install library from the command line:
composer install
- Generate UUID Version 4:
<?php
use Ramsey\Uuid\Uuid;
require_once __DIR__.'/vendor/autoload.php';
$uuidV4 = (string) Uuid::uuid4();
echo $uuidV4;
Leave a Comment
Cancel reply