check allow ip

public function checkAllowIP(){
           
            $chunks = explode('.', $_SERVER['REMOTE_ADDR']);
            $whitelist = array(127,192,71,...);

            if(in_array($chunks[0], $whitelist))
            {
                return true;
            }
            else
            {
                //Show maintenance message
                die("The site is down for maintenance.");
            }
        }

Related posts:

This entry was posted in knowledge, php. Bookmark the permalink.