Blogger Information
Blog 10
fans 1
comment 0
visits 12883
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
PHP常用操作
GrMax的博客
Original
1080 people have browsed it
header("Content-type: text/html; charset=utf-8"); //申明编码,以免页面乱码

//去掉内容中所有空格:
$qian=array(" "," ","\t","\n","\r");
$hou=array("","","","","");
$data['name']=str_replace($qian,$hou,$str);    

gethostbyname($_ENV['COMPUTERNAME'])//获取本机IP:

//全部转为大写字母
strtoupper()

 $_SERVER['HTTP_REFERER'];//获取上一页的URL地址
 
 获得用户IP
function getIpAddress() 
{ // 取得当前用户的IP地址 
if (getenv('HTTP_CLIENT_IP')) 
{ $ip = getenv('HTTP_CLIENT_IP'); }
 elseif (getenv('HTTP_X_FORWARDED_FOR'))
  { $ip = getenv('HTTP_X_FORWARDED_FOR'); } 
  elseif (getenv('REMOTE_ADDR')) 
  { $ip = getenv('REMOTE_ADDR'); } else
  { $ip = $_SERVER['REMOE_ADDR']; }  
  return $ip;}
 
//过滤数组中为空的值
array_filter()


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post