- function is_localhost() {
- $localhost_ids = array('localhost', '127.0.0.1');
- if(in_array($_SERVER['HTTP_HOST'],$localhost_ids)){
- // not valid
- return 1;
- }
- }
- //该片段来自于http://www.codesnippet.cn/detail/090120131458.html
来源: http://www.codesnippet.cn/detail/090120131458.html