Imaulle Posted May 21, 2012 Share Posted May 21, 2012 Hello, is this ok to do? or should I add in some type of fail safe in case for some reason the server is down etc? If so, how? public function check_update() { $query = $this->db->where('setting_name', 'version')->get('settings')->row(); $latest = file_get_contents('http://www.mydomain.com/version.txt') ) if ( version_compare($query->value, $latest, '<') ) return true; else return false; } Link to comment https://forums.phpfreaks.com/topic/262876-file_get_contents-what-to-do-if-url-not-respond/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.