Don't you mean BINARY (36) instead of BINARY (16)
Try http://pecl.php.net/package/uuid
CakePHP has some neat functionality for uuids and automatically works for CHAR (36) and BINARY (36) from what I understand. In any case, you could delve into the source a bit to find out if it has what you need.
Edit: here is a standalone class that can generate and convert to almost any format you may need: http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/ I posted this in the following comments, but I wanted to make sure that the link is easily visible to other users.
source share