发布时间:2014-11-21 14:08:22
//编码,编码后为小写function escape($str){preg_match_all("/[\x80-\xff].|[\x01-\x7f]+/",$str,$newstr);$ar = $newstr[0];foreach($ar as $k=>$v){ if(ord($ar[$k])>=127){ $tmpString=bin2hex(iconv("GBK","ucs-2//IGNORE",$v)); if (!eregi("WIN",PHP_OS)){ &nbs.........【阅读全文】
发布时间:2014-11-20 15:16:40
本例可以实现1.符合规则定义的伪静态访问路径解析 对于"test.php/user/lists/normal/id/2.html" 可解析为 control = user,action = lists,filter = normal,order = id,curPage = 3 对于"test.php/users/lists.html" 可解析为 co.........【阅读全文】
发布时间:2014-11-17 15:18:02
1.php导出CSV文件<?phpheader( "Cache-Control: public" ); header( "Pragma: public" );header("Content-type:application/vnd.ms-excel"); header("Content-Disposition:attachment;filename=txxx.csv"); header('Content-Type:APPLICATION/OCTET-STREAM');ob_start();$h.........【阅读全文】
发布时间:2014-11-15 11:13:31
如果txt不是UTF-8编码使用gedit打开时可能会乱码,可以这样解决解:开终端输入:gsettings set org.gnome.gedit.preferences.encodings auto-detected "['GB18030', 'GB2312', 'GBK', 'UTF-8', 'BIG5', 'CURRENT', 'UTF-16']"gsettings set org.gnome.gedit.preferences.encodings shown-in-menu "['GB18030', 'GB2312',.........【阅读全文】
发布时间:2014-11-14 14:45:17
<?php public function file_get_contents_post($url, $post) { $options = array( 'http' => array( 'method' => 'POST', 'content' => http_build_query($post), ), ); $result = file_get_contents($url, false.........【阅读全文】