User:Niaht Nakamichi/PHP Code
Jump to navigation
Jump to search
is_uuid
<php> function is_uuid($uuid) { $lengths = array(8, 4, 4, 4, 12);
if (strlen($uuid) !== 36) return false;
$uuid = explode('-', $uuid);
if (count($uuid) !== 5) return false;
foreach($uuid as $key => $value) { if (strlen($value) !== $lengths[$key]) return false; if (!ctype_xdigit($value)) return false; }
return true; } </php>