php 判断访客是否为搜索引擎蜘蛛的函数代码
实现代码如下: /** * 判断是否为搜索引擎蜘蛛 * * @author Eddy * @return bool */ function isCrawler() { $agent= strtolower($_SERVER['HTTP_USER_AGENT']); if (!empty($agent
实现代码如下: /** * 判断是否为搜索引擎蜘蛛 * * @author Eddy * @return bool */ function isCrawler() { $agent= strtolower($_SERVER['HTTP_USER_AGENT']); if (!empty($agent
实现代码如下: '; }2: scandir 读取指定目录到数组 实现代码如下: function listFiles($path){ $result = array(); foreach( scandir($path) as $item ){ if($item != '.' $result[st
实现代码如下: function get_word($string, $length, $dot = '..',$charset='gbk') { if(strlen($string) '), array('','',' $strcut = ''; if(strtolower($charset) =
实现代码如下:function getSeoVersion($phrase) { return preg_replace('/[^a-z0-9_-]/i', '', strtolower(str_replace(' ', '-', trim($phrase)))); } // example usa
验证码时用 strtolower($str) 转小写 strtoupper 转大写 当需要给本也面传值时,可以用AJAX,等很多方法, var url = "xxx.php"; var data={}; $.post{url ,data,function(){ if(data){ ale
只是这样就需要转换两次。大多时候,我们是针对字符集转换的时候才会这样,比如判断参数传进来是否utf-8,这5个字符的写法,可就多了,比如UTF-8,Utf-8,utf-8等,那我们怎么办呢?strtolower?strupper?不需要啦。。 strncasecmp($a,$b,$length)就可