Skip to content

Instantly share code, notes, and snippets.

View Thiagothims's full-sized avatar
🎯
Focusing

Thiago de Mattos Santos Thiagothims

🎯
Focusing
View GitHub Profile
@Joel-James
Joel-James / verify-uuid.php
Last active March 6, 2024 22:26
Check if UUID is in valid format
<?php
/**
* Check if a given string is a valid UUID
*
* @param string $uuid The string to check
* @return boolean
*/
function isValidUuid( $uuid ) {
if (!is_string($uuid) || (preg_match('/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', $uuid) !== 1)) {