摘要: sql语句为:$sql="select count(*) from com where a_id=$v['id']"; 出现以下错误: 原因: 变量没有用花括号引起来 改为: $sql="select count(*) from com where a_id={$v['id']}"; 阅读全文
posted @ 2017-08-21 14:36 yolo_bean 阅读(6310) 评论(1) 推荐(1)
摘要: 为了避免当调用的方法不存在时产生错误,可以使用 __call() 方法来避免。该方法在调用的方法不存在时会自动调用,程序仍会继续执行下去 该方法有两个参数,第一个参数 $function_name 会自动接收不存在的方法名,第二个 $args 则以数组的方式接收不存在方法的多个参数 可利用该函数实现 阅读全文
posted @ 2017-08-21 10:59 yolo_bean 阅读(228) 评论(0) 推荐(0)
摘要: func_get_args 获取一个函数的所有参数 { $numargs = func_num_args(); //参数数量 echo "参数个数是: $numargs<br />\n"; if ($numargs >= 2) { echo "第二个参数的值:" . func_get_arg(1) 阅读全文
posted @ 2017-08-21 10:01 yolo_bean 阅读(465) 评论(0) 推荐(0)
摘要: 2017-8-21 在sublime text中 代码整体往前移的快捷键是什么?shift+Tab 2017-8-24 2017-10-7 sublime test中如何快速生成html5头部? 2017-10-15 2017-10-24 2017-11-2 阅读全文
posted @ 2017-08-21 09:52 yolo_bean 阅读(130) 评论(0) 推荐(0)
摘要: 在页面的最前页加上date_default_timezone_set(PRC); /*把时间调到北京时间,php5默认为格林威治标准时间*/date ()a: "am"或是"pm" A: "AM"或是"PM" d: 几日,两位数字,若不足则补零;从"01"至"31" D: 星期几,3个英文字母,如: 阅读全文
posted @ 2017-08-21 07:30 yolo_bean 阅读(1261) 评论(0) 推荐(0)