He did. Get a random number from 0 to 4294967295 (The maximum number that can be represented in hexidecimal representations) then convert it to hex using the dechex() function.
http://php.net/manual/en/function.dechex.php