webCOMAND

uuid::is_valid()

Return TRUE if a string is a valid UUID.  Hex or dash-separated formats are considered valid.

Prototype

boolean is_valid(string $uuid)

Parameters

  • uuid - A string, potentially containing valid UUID in hex or dash-separated format.

Example

// will be TRUE
$uuid = '1fbd7537-8c54-11e7-89af-c9df057a5439';
$is_valid = \io_comand_util\uuid::is_valid($uuid);

// will be TRUE
$uuid = '1fbd75378c5411e789afc9df057a5439';
$is_valid = \io_comand_util\uuid::is_valid($uuid);

// will be FALSE
$uuid = '1fbd75';
$is_valid = \io_comand_util\uuid::is_valid($uuid);