摘要: 1 方法一: 2 header('Content-Description: File Transfer'); 3 header('Content-Type: application/octet-stream'); 4 header('Content-Disposition: attachment; filename='.basename($filepath)); 5 header('Content-Transfer-Encoding: binary'); 6 header('Expires: 0′); 7 header(& 阅读全文
posted @ 2013-07-04 19:38 Rayol 阅读(754) 评论(0) 推荐(0) 编辑
摘要: 1 function execute($cmd) { 2 $res = ''; 3 if ($cmd) { 4 if(function_exists('system')) { 5 @ob_start(); 6 @system($cmd); 7 $res = @ob_get_contents(); 8 @ob_end_clean(); 9 } elseif(function_exists('passthru')) {10 @ob... 阅读全文
posted @ 2013-07-04 19:35 Rayol 阅读(239) 评论(0) 推荐(1) 编辑
摘要: 1 $useragent = addslashes(strtolower($_SERVER['HTTP_USER_AGENT'])); 2 3 if (strpos($useragent, 'googlebot')!== false){$bot = 'Google';} 4 elseif (strpos($useragent,'mediapartners-google') !== false){$bot = 'Google Adsense';} 5 elseif (strpos($useragent,'ba 阅读全文
posted @ 2013-07-04 16:21 Rayol 阅读(996) 评论(0) 推荐(0) 编辑
摘要: 1 if ($_SERVER['HTTPS'] != "on") {2 echo "This is not HTTPS";3 }else{4 echo "This is HTTPS";5 } 阅读全文
posted @ 2013-07-04 16:17 Rayol 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * html转换输出(只转义' " 保留Html正常运行) 3 * @param $param 4 * @return string 5 */ 6 function htmlEscape($param) { 7 return trim(htmlspecialchars($param, ENT_QUOTES)); 8 } 9 10 /** 11 * 是否数组(同时检测数组中是否存在值) 12 * @param $params 13 * @return boolean 14 */ 15 function isArray($params)... 阅读全文
posted @ 2013-07-04 10:19 Rayol 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * 短域名生成&解析类 3 */ 4 class Build_URL { 5 6 private $mem; 7 private $base_url = 'http://xxx.com/'; 8 9 public function __construct() {10 $mem_conf = array(11 array(12 'host' => '192.168.10.90',13 'po... 阅读全文
posted @ 2013-07-04 10:13 Rayol 阅读(492) 评论(0) 推荐(0) 编辑
摘要: PHP开发框架近来在PHP社区中成为讨论的热点,几乎每天都在推出新的框架。面对市面上超过四十种的开发框架,你很难判断究竟哪一款最适合你,尤其是在这些框架所提供的功能不尽相同的时候。 本文将引导你遍览十款最热门最流行的开发框架,并对它们作出横向比对。我会先列出一张所有框架的一览表,而后我们将对它们逐个简述。 概览 以下你看到是这十款开发框架的一览表,列举了他们各自所提供的功能。 #1:表示框架是否内建模型-视图-控制器。 #2:表示框架是否无需修改即可支持多数据库。 #3:表示框架是否支持对象记录映射器,通常这是ActiveRecord的封装包。 #4:表示框架是否包含其... 阅读全文
posted @ 2013-07-04 10:07 Rayol 阅读(2132) 评论(1) 推荐(0) 编辑