I want convert this string to uuid4 by PHP functions
my string: 24:1D:87:0E:01:32:09:FB:36:97:23:BD:B5:E1:18:04
convert to : 241d870e-0132-49fb-b697-23bdb5e11804
how can do it?! php have function or?!...
I want convert this string to uuid4 by PHP functions
my string: 24:1D:87:0E:01:32:09:FB:36:97:23:BD:B5:E1:18:04
convert to : 241d870e-0132-49fb-b697-23bdb5e11804
how can do it?! php have function or?!...
You could do a combination of:
str_replace()
to strip out the :
colonssubstr()
the sections you need. "-" .
strtolower()
if that's really requiredOr, you could write a regex/preg_replace
transformation.