Home  >  Article  >  Backend Development  >  What is the reason why php equals judgment and writing in reverse?

What is the reason why php equals judgment and writing in reverse?

WBOY
WBOYOriginal
2016-08-26 10:12:561047browse

When I looked at thinkPHP source code recently, I saw that some judgment methods are written in reverse, for example:

<code>if(''==$name) { // 获取全部变量
        $data       =   $input;
        $filters    =   isset($filter)?$filter:C('DEFAULT_FILTER');
        if($filters) {
            if(is_string($filters)){
                $filters    =   explode(',',$filters);
            }
            foreach($filters as $filter){
                $data   =   array_map_recursive($filter,$data); // 参数过滤
            }
        }
    }</code>

Xiaobai, please explain why it is ''==$name instead of $name ==''?
What is the difference between the two?
Thank you!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn