How to check UUID on PHP
Hi there!
So, if you need to check the UUID string you just need to use the next regular expression:
preg_match('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/', $string);
That’s it!
Hi there!
So, if you need to check the UUID string you just need to use the next regular expression:
preg_match('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/', $string);
That’s it!