php网站来路获取代码(针对搜索引擎)

yipeiwu_com5年前PHP代码库
复制代码 代码如下:

function get_referer(){
$se = 0;
$url = $_SERVER["HTTP_REFERER"]; //获取完整的来路URL
$str = str_replace("http://","",$url); //去掉http://
$strdomain = explode("/",$str); // 以“/”分开成数组
$domain = $strdomain[0]; //取第一个“/”以前的字符
if(strstr($domain,'baidu.com')){
$se = 1;
}
else if(strstr($domain,'google.cn')){
$se = 1;
}
return $se;
}

相关文章

PHP array 的加法操作代码

The + operator appends elements of remaining keys from the right handed array to the left han...

PHP+jQuery实现滚屏无刷新动态加载数据功能详解

本文实例讲述了PHP+jQuery实现滚屏无刷新动态加载数据功能。分享给大家供大家参考,具体如下: index.php <?php require_once('conn...

array_multisort实现PHP多维数组排序示例讲解

array_multisort — 对多个数组或多维数组进行排序 说明 bool array_multisort ( array ar1 [, mixed arg [, mixed .....

发一个php简单的伪原创程序,配合商城采集用的

复制代码 代码如下: <?php $arr=array(); $arr['好']='坏'; $arr['不好']='不坏'; $arr['坏']='好'; $arr['不坏']='...

PHP中uploaded_files函数使用方法详解

对PHP语言有些了解的朋友们都知道,它包含有功能强大的函数库。我们今天就一起来了解一下PHP uploaded_files函数的具体功能。 在早期的PHP版本中,上传文件很可能是通过如下...