PHP code example of macx / rfc-4122-uuid

1. Go to this page and download the library: Download macx/rfc-4122-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/ */

    

macx / rfc-4122-uuid example snippets




$uuid = macx\UUID::v4();

echo 'The generated UUID is `' . $uuid . '`';

$givenId = 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6';

if(macx\UUID::is_valid($givenId)) {
  // do something
}