PHP code example of hraw / uuid
1. Go to this page and download the library: Download hraw/uuid library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hraw / uuid example snippets
raw\Uuid\UuidV4;
//Generating a version 4 uuid.
echo UuidV4::get();
//Output -> 42ebbe3f-f47e-43d6-b2b2-3b19f5fa6a20
//Validating a version 4 uuid.
UuidV4::validate('42ebbe3f-f47e-43d6-b2b2-3b19f5fa6a20');
//Output -> true/false