Advertisement
Corosus

Untitled

Feb 15th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. function getMCModifiedDate() {
  2.  
  3. $curl = curl_init($this->mcURL);
  4.  
  5. //don't fetch the actual page, you only want headers
  6. curl_setopt($curl, CURLOPT_NOBODY, true);
  7.  
  8. //stop it from outputting stuff to stdout
  9. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  10.  
  11. // attempt to retrieve the modification date
  12. curl_setopt($curl, CURLOPT_FILETIME, true);
  13.  
  14. $result = curl_exec($curl);
  15.  
  16. if ($result === false) {
  17. die (curl_error($curl));
  18. }
  19.  
  20. $timestamp = curl_getinfo($curl, CURLINFO_FILETIME);
  21. if ($timestamp != -1) { //otherwise unknown
  22. return $timestamp;
  23. }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement