预览模式: 普通 | 列表

今天220.181.108.95和180.76.5.91来访了

不再仅仅是令人懊恼的123.125.*.*了,希望这是个好兆头。虽然咱不靠百度吃饭,不过怎么说呢。。面子问题。

220.181.108.95 Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html) 200 0 64
180.76.5.91 Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html) 200 0 0

 

Tags: 百度

分类:随笔杂记 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2618

php字符串过滤空格多个空格只保留一个

 Asp实现的方法见:https://blog.guanjianci.net/article.asp?id=547

PHP代码
  1. $text='  你  好  世         界!    ';  
  2. function blank($text){  
  3.     $text=trim($text);  
  4.     $x=0;  
  5.     while($x==0){  
  6.         $text=str_replace('  ',' ',$text);  
  7.         if(!strpos('@'.$text,'  ')){  
  8.             $x=1;  
  9.         }  
  10.     }  
  11.     return $text;  
  12. }  
  13. echo blank($text);  

代码执行结果:你 好 世 界!

Tags: php

分类:技术文章 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 3787

utf8中文正则匹配问题

PHP代码
  1. if(!preg_match("/^[\x{4e00}-\x{9fa5}A-Za-z0-9]+$/u",$word)){  
  2. echo '不是中文!';  
  3. }  

Tags: php 正则表达式

分类:技术文章 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2165

php函数str_replace的使用方法总结

字符串取代。

语法: string str_replace(string needle, string str, string haystack);

返回值: 字符串

函数种类: 资料处理

查看更多...

Tags: php

分类:技术文章 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2283

 广告位

↑返回顶部↑