We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

xuanyan on 06/01/08


Tagged

textmate guid


Versions (?)


Who likes this?

1 person has 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.