Posted By

xuanyan on 06/01/08


Tagged

textmate guid


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

heinz1959


to_guid_string


 / Published in: PHP
 

  1. function to_guid_string($mix)
  2. {
  3. if(is_object($mix) && function_exists('spl_object_hash')) {
  4. return spl_object_hash($mix);
  5. }elseif(is_resource($mix)){
  6. $mix = get_resource_type($mix).strval($mix);
  7. }else{
  8. $mix = serialize($mix);
  9. }
  10. return md5($mix);
  11. }

Report this snippet  

You need to login to post a comment.