手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表分类:PHP

推荐阅读:PHP

看这里: https://blog.jetbrains.com/phpstorm/2017/06/php-annotated-monthly-june-2017/

其实在blog.jetbrains.com/phpstorm上,有很多PHP的使用方法和IDE的奇技淫巧。比如教你怎么远程debug之类的
我先贴点原文中的链接。如果要看更多,可以点击上面的链接
 

PHP 7.2 will have some great new features, keep your eye on this blog for a roundup once I’ve had a chance to look at the alpha in the coming weeks.

Other good posts on PHP and general development this month:

Frameworks and Libraries

We’ve got the usual slew of Laravel and Zend Framework posts, along with some interesting posts for WordPress, Yii and some more useful articles on Composer and Packagist.

Yii

Laravel

Zend Framework

Symfony

Other

Community, Career, and Events

There was an interesting interview with Taylor Otwell, creator and lead developer of Laravel tells us why Taylor Otwell Wants You To Build Your PHP Apps On Laravel. I also enjoyed an interview with Anna Filina On PHP Trainings And Future Of PHP Frameworks.

An interesting question is posed in Can 9-to-5 Developers Be Good Developers? While I disagree vehemently with some of the points made in the article, it makes for an interesting discussion.

This month I’ll be at PHP South Coast in Portsmouth this week, and DPC in Amsterdam at the end of the month. Make sure you come and say “Hi!” if you see me at any events.

好东西实在太多。。。
 

yii2 orwhere andwhere的复杂写法

 如果仅仅是多个orwhere条件,其实就是默认的andWhere和orWhere的标准写法,但如果条件是:

queue_name != '' and ( queue_status = '' or (queue_status ='error' and retry = 0))这样的要求,用Yii AR 就比较难写了。
demo如下:
 
PHP代码
  1. $files = XXXX::find()  
  2.                ->andWhere(['<>''queue_name'''])  
  3.                ->andWhere(['or',  
  4.                    ['queue_status' => ''],  
  5.                    [  
  6.                        'and',  
  7.                        ['queue_status' =>'error'],  
  8.                        ['retry' => 0]  
  9.                    ]  
  10.                ])  
  11.                ->all();  
其实也就这样了。。
重点:
1、不等于的写法
2、或条件其实不是用orWhere,而是用andWhere
3、如果orWhere条件中有双重条件,得使用数组,并使用and进行连接
 
BTW:今天是PHPcon的第一天,然而我却没空去。我是陪读的书童~~~
 

TCPDF - Chinese encoding UTF-08 fonts

参考 : http://call-me-early.blogspot.hk/2012/02/tcpdf-chinese-encoding-utf-08-with.html

 

» 阅读全文

Tags: tcpdf

<?php//test

标题对应的代码会报错:Use of undefined constant php - assumed 'php'

PHP代码
  1. <?php//test  
果然 有时候还得留个空格啊。万事留一线,日后好相见,说的就是这个道理吧?
 
 

Laravel action helper函数用法

原本以为是很简单的一个用法。

action('XxxxController@test',['abc'=>1]);
结果,不仅仅是这样的,
 
如果你的XxxxController@test,没有在router里定义过。会直接报错,报:App\Http\Controller\XxxController@test 不存在,虽然 你很明确的知道它就在那里!
 
原来我 写URL的时候都是直接写 url('abc/def'),其实应该用action('xxxcontroller@def'),好处是,action是可以带参数的。url你永远带不进参数!!!
 
纯记录。NND