博客园  :: 首页  :: 新随笔  :: 订阅 订阅  :: 管理
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 32 下一页

2013年4月15日

摘要: 布局特点:顶部固定、导航菜单固定、底部永远处于页面底部。代码如下:<!DOCTYPE html><html><head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <style type="text/css"> html, body { padding:0; margin:0; height:100%; position:re 阅读全文

posted @ 2013-04-15 11:11 PHP-张工 阅读(1133) 评论(1) 推荐(0)

2013年4月14日

摘要: 打开chrome目录下的C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\User Data\Default\User StyleSheets\Custom.css文件,添加如下样式:::-webkit-scrollbar { -webkit-appearance: none; width: 10px; height: 10px;}::-webkit-scrollbar-thumb { border-radius: 4px; border: 2px solid white; 阅读全文

posted @ 2013-04-14 11:07 PHP-张工 阅读(1631) 评论(1) 推荐(0)

2013年4月11日

摘要: function getHtml($url, $charset='utf-8'){ $curl = curl_init(); //curl_setopt($curl, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:192.168.168.1', 'CLIENT-IP:192.168.168.1'));//IP curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_REFERER, ""); //来路 $user 阅读全文

posted @ 2013-04-11 11:31 PHP-张工 阅读(2903) 评论(0) 推荐(0)

2013年3月13日

摘要: 使用JS处理触摸事件,实现图片的拖动缩放。将网页添加到主屏时,设置图标<link rel="apple-touch-icon-precomposed" href="images/icon.png">禁止IPAD自己的页面缩放功能<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">禁止页面的整体拖动document.body.addEventListener(' 阅读全文

posted @ 2013-03-13 10:15 PHP-张工 阅读(3151) 评论(1) 推荐(0)

2013年2月28日

摘要: PHP 中获取mysql的float字段,echo 输出后,小数部分为包含多个0.可使用 floatval($num) 将0舍去。如要保留小数位,可使用number_format($num, 2);number_format函数对超过指定位数的值,进行了四舍五入。如不想四舍五入,而保留所有小数。可使用如下方法:// 如仅想保留两位小数可用 number_format($num, 2);echo f('1001.334534', 2) . '<br>'; // 1001.334534echo f('-1001.000', 2) . &# 阅读全文

posted @ 2013-02-28 12:11 PHP-张工 阅读(1834) 评论(0) 推荐(0)

2013年2月27日

摘要: $format = 'The %2$s contains %1$04d monkeys! %s apples.';echo sprintf($format, 4, 'tree');// output: The tree contains 0004 monkeys! 4 apples.// number_format(数字, 保留小数位数, 小数分割符='.', 千分位分隔符=',');$num = 1234.567;echo number_format($num); // 1,235echo number_format($num, 阅读全文

posted @ 2013-02-27 10:45 PHP-张工 阅读(2910) 评论(0) 推荐(0)

2013年2月26日

摘要: PHP如何扑捉未处理异常class MyException extends Exception{ function MyException($message, Exception $ex = NULL) { $this->message = $message; $this->innerException = $ex; } public $innerException = NULL;}function exception_handler($exception){ $s = '<pre>' . var_export($exception, true) . & 阅读全文

posted @ 2013-02-26 21:54 PHP-张工 阅读(426) 评论(0) 推荐(0)

摘要: 网上关于PDO的资料很多。这里就不累赘了。这里我将PDO所有操作封装到一个类里方便操作。类代码如下:class DB { //pdo对象 public $con = NULL; function DB() { $this->con = new PDO("mysql:host=127.0.0.1;dbname=dbtest", "root", "xxx", array( PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES `utf8`', PDO::ATTR_PERSISTE 阅读全文

posted @ 2013-02-26 21:38 PHP-张工 阅读(685) 评论(0) 推荐(0)

2013年2月19日

摘要: 关于smarty请参考:http://www.php100.com/manual/smarty/index.htmlIndex.phprequire('../libs/Smarty.class.php');$smarty = new Smarty;// 添加自定义调节器$smarty->registerPlugin("modifier", "e", "htmlspecialchars");$smarty->registerPlugin("modifier", "trim&quo 阅读全文

posted @ 2013-02-19 19:01 PHP-张工 阅读(844) 评论(0) 推荐(0)

摘要: 在VS的扩展管理器里,添加【PHP Tools for Visual Studio】扩展就可以在VS里编辑PHP了。这个扩展能使VS支持PHP语法高亮,最重要的是支持智能提示。只可以我还没有找到破解版。但可试用21天。效果如下:再推荐几个好用的VS扩展【Indent Guides】效果如下:【Productivity Pover Tools】这个就不多说了。很好用。有园友已经介绍过了。http://www.cnblogs.com/hamson/archive/2013/02/16/productivity-power-tools-2012.htmlCtrl+Alt+]格式化代码很爽哦。 阅读全文

posted @ 2013-02-19 18:48 PHP-张工 阅读(15676) 评论(4) 推荐(0)

上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 32 下一页