![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
php
dengfei00100
这个作者很懒,什么都没留下…
展开
-
php常用变量、常量积累
1.DIRECTORY_SEPARATOR 根据特定系统的文件分隔符原创 2015-03-19 09:11:19 · 362 阅读 · 0 评论 -
phpstorm激活server
http://idea.imsxm.com/http://114.215.133.70:41017/http://172.245.22.235:1017/http://diy-cia48621793.rhcloud.com/详情走:http://idea.lanyus.com/原创 2016-08-15 09:18:26 · 651 阅读 · 0 评论 -
php把字符串做为代码执行的函数eval
extract($sms_param, EXTR_PREFIX_SAME, "wddx"); $mtm = MessageTemplateModel::where('msg_template_code', $this->sms_template_code)->first(); eval('eval("\$data[\'content\'] =原创 2016-08-23 16:41:56 · 2920 阅读 · 0 评论 -
phpstorm设置等号对齐
设置等号对齐,及数组key-value对齐原创 2016-08-09 10:50:05 · 22245 阅读 · 3 评论 -
php匿名函数,参数及怎么掉的问题,终极大揭秘
laravel中匿名函数使用居多, 不搞清楚匿名函数参数及调用的问题,laravel没法搞,废话不多说,上代码:class Foo { public function f() { echo 'Foo....f'; }}class Too { public function t($name, Closure $c) {原创 2016-06-23 14:32:06 · 714 阅读 · 0 评论 -
比较时间格式是否相等的函数
/** * 验证是不是正确的日期格式 y-m-d y/m/d 皆可 * 是返回true 反之false * @param type $date * @param type $formats * @return boolean */function checkDateIsValid($date, $formats = ["Y-m-d", "Y/m/d"]) { $unix原创 2016-07-19 14:06:09 · 763 阅读 · 0 评论 -
php开发规范 psr
https://psr.phphub.org/转载 2016-06-22 14:06:08 · 253 阅读 · 0 评论 -
apache虚拟主机的配置
打开httpd.conf文件去掉LoadModule vhost_alias_module modules/mod_vhost_alias.so这句前面的#号和Include conf/extra/httpd-vhosts.conf这句前面的#号Include conf/extra/httpd-vhosts.conf这句在httpd.conf文件底部然后打开Apache2.2\co原创 2016-05-20 10:46:31 · 420 阅读 · 1 评论 -
面向对象编程的基本原则
转载 2016-04-16 12:33:56 · 227 阅读 · 0 评论 -
php魔术常量,魔术方法
魔术常量:1。__LINE__返回文件中的当前行号。2。__FILE__ 返回文件的完整路径和文件名。如果用在包含文件中,则返回包含文件名。自PHP4.0.2 起,__FILE__总是包含一个绝对路径,而在此之前的版本有时会包含一个相对路径。3。__FUNCTION__ 返回函数名称(PHP4.3.0 新加)。自PHP5 起本常量返回该函数被定义时的名字(区分大小写)。转载 2016-04-15 10:58:58 · 350 阅读 · 0 评论 -
PSR-0标准
[1]命名空间必须与绝对路径一致[2]类名首字母必须大写[3]除去入口文件外,其他“.php”必须只有一个类[4]php类文件必须自动载入,不采用include等[5]单一入口原创 2016-04-15 09:39:08 · 288 阅读 · 0 评论 -
mysql found_rows函数
使用方法如下 ,分页的时候配合SQL_CALC_FOUND_ROWS使用 /** * limit 每页显示多少条 * where 条件 * 根据条件获取全屋购列表 */ public function get_list($where = "", $limit = 1) { //分页处理 $pa原创 2016-03-11 14:38:10 · 980 阅读 · 0 评论 -
ajax 传参数问题
1. 将表单元素放入对象里面 , 直接传对象过去即可var post = new Object(); //alert(post.join('*'));原创 2015-12-21 16:59:30 · 363 阅读 · 0 评论 -
php定时任务,任务系统
http://blog.sina.com.cn/s/blog_5357c0af0100uf77.html用Linux下的cron服务定时执行php程序原创 2015-12-14 10:22:45 · 466 阅读 · 0 评论 -
php下获取时间的毫秒表示,非时间戳
List($usec, $sec) = explode(' ', microtime()); $time = date("YmdHis") . round($usec * 1000);原创 2015-11-02 16:17:41 · 460 阅读 · 0 评论 -
INSERT ... ON DUPLICATE KEY UPDATE 插入或者更新一起写 。掉咋天
INSERT INTO table (a,b,c) VALUES (1,2,3) ON DUPLICATE KEY UPDATE c=c+1; UPDATE table SET c=c+1 WHERE a=1; 向数据库插入记录时,有时会有这种需求,当符合某种条件的数据存在时,去修改它,不存在时,则新增,也就是saveOrUpdate操作。这种控转载 2015-09-07 15:17:35 · 535 阅读 · 0 评论 -
php 视图页面form类,非常有用
<?phpclass form { /** * 编辑器 * @param int $textareaid * @param int $toolbar * @param string $module 模块名称 * @param int $catid 栏目id * @param int $color 编辑器颜色 * @param boole $allowupload原创 2015-03-16 15:17:17 · 442 阅读 · 0 评论 -
php数组转换为json中文乱码解决方案
//解决json中文乱码 private function JSON($array) { $this->arrayRecursive($array, 'urlencode', true); $json = json_encode($array); return urldecode($json); } private func转载 2015-03-16 14:52:22 · 2585 阅读 · 0 评论 -
php无限分类与树形菜单
<?phpnamespace App\lib;/** * @name PHPTree * @author crazymus * @des PHP生成树形结构,无限多级分类 * @version 1.2.0 * @Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) * @updated 2015-08-26 */转载 2016-12-22 17:52:02 · 4010 阅读 · 0 评论