摘要: function nl2p($string, $line_breaks = true, $xml = true){ // Remove existing HTML formatting to avoid double-wrapping things $string = str_replace(array('', '', '', ''), '', $string); // It is conceivable that people might still want single line-breaks // with 阅读全文
posted @ 2013-12-17 09:28 FreeSpider 阅读(3658) 评论(0) 推荐(0) 编辑
摘要: $str="hello world 你好世界~"; $num = preg_match_all("/[a-zA-Z]/",$str,$words); echo $num; print_r($words); $num = preg_match_all("/[\xB0-\xF7][\xA1-\xFE]/",iconv('UTF-8','GBK',$str),$words); 阅读全文
posted @ 2013-12-17 09:25 FreeSpider 阅读(129) 评论(0) 推荐(0) 编辑