随笔分类 -  经典问题

获得图片颜色---摘自php手册
摘要:Example #1 imagecolorsforindex() 例子 ';print_r($color_tran);echo'';?> 本例将输出: Array( [red] => 226 [green] => 222 [blue] => 252 ... 阅读全文

posted @ 2014-05-13 10:53 左小兵 阅读(187) 评论(0) 推荐(0)

万能写入sql语句,并且防注入
摘要:通过perpare()方法和检查字段防sql注入.$pdo=new PDO('mysql:host=localhost;dbname=scms', 'root' );$_POST=array('title'=>23,'content'=>'kmm');$keys= array_keys($_POST... 阅读全文

posted @ 2014-04-29 07:16 左小兵 阅读(1321) 评论(0) 推荐(0)

递归遍历目录的迭代器方式
摘要:getDepth()); if ($file->isDir()) { echo DIRECTORY_SEPARATOR; } echo $file->getBasename(); if ($file->isFile()) { echo " (" .$file->getSize()... 阅读全文

posted @ 2014-04-21 02:07 左小兵 阅读(338) 评论(0) 推荐(0)

递归遍历多维数组(树数据结构)的超级简单方式,并且可以递归超过200层,摘自<<PHP精粹:编写高效PHP代码>>
摘要:$value) { echo "Depth: " . $recursiveIteratorIterator->getDepth() . PHP_EOL; echo "Key: " . $key . PHP_EOL; echo "Value: " .$value . PHP_EOL;}?> 阅读全文

posted @ 2014-04-18 12:36 左小兵 阅读(654) 评论(0) 推荐(0)

http协议传输二进制数据以及对输入流(php://input)和http请求的理解
摘要:1.index.php array( 'method' => 'POST', 'header' => "Content-type: application/x-www-form-urlencoded\r\n" ... 阅读全文

posted @ 2014-04-18 12:10 左小兵 阅读(601) 评论(0) 推荐(0)

使用PHP的curl扩展实现跨域post请求,以及file_get_contents()百度短网址例子
摘要:'http://www.cnblogs.com/zuoxiaobing/');curl_setopt($ch,CURLOPT_POSTFIELDS,$data);$strRes=curl_exec($ch);curl_close($ch);$arrResponse=json_decode($strR... 阅读全文

posted @ 2014-04-15 16:58 左小兵 阅读(1814) 评论(0) 推荐(0)

jquery选取iframe
摘要:$(window).load(function(){ $('iframe').contents().find('form'); }) 阅读全文

posted @ 2014-04-15 16:19 左小兵 阅读(191) 评论(0) 推荐(0)

将HTML段赋值给PHP变量的便捷方法,不使用转义字符
摘要:{$b} sss; echo $a;?> 阅读全文

posted @ 2014-04-06 21:17 左小兵 阅读(621) 评论(0) 推荐(0)

百度地图实现思路--------未实践------未验证
摘要:实时加载图片图片大小是256*256我以前一直以为是像素级改变。 阅读全文

posted @ 2014-03-29 08:27 左小兵 阅读(142) 评论(0) 推荐(0)

导航