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; } Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.