So I\'ve been doing some digging around and I\'ve been trying to piece together a function that generates a valid v4 UUID in PHP. This is the closest I\'ve been able to come
on unix systems, use the system kernel to generate a uuid for you.
file_get_contents('/proc/sys/kernel/random/uuid')
Credit Samveen on https://serverfault.com/a/529319/210994
Note!: Using this method to get a uuid does in fact exhaust the entropy pool, very quickly! I would avoid using this where it would be called frequently.