不是这样的,意思是:
$add=$add.$usertype
这个的简写。

解决方案 »

  1.   

    举个例子,如果$add是“abc”,$usertype是“def”,则运行
    $add.=$usertype;//结果为$add等于“abcdef”
      

  2.   

    这里有详细介绍:http://cn.php.net/manual/zh/language.operators.string.php
      

  3.   

    $add.=$user_type?" AND usertype={$user_type}":'';
    这事整句,其实因为我要判断一下$user_type是否是空值,然后再运行后面的语句,但是这样能够判断空值吗,
      

  4.   

    $add.=empty($user_type)?"":" AND usertype={$user_type}"; 
      

  5.   

    我想是不是应该这样理解,
    $add.=empty($user_type)?"":" AND usertype={$user_type}"; 
    empty($user_type)?这个是if判断的部分,而$add.=是在判断完成后加上应加的部分,毕竟三元(?..:..)运算符的优先权比赋值运算符高,所以不是先赋值,是先判断
    而这里应该用empty($user_type)?,而不用$usertype?,因为empty可以完成空值,为定义,0,等一系列判断,我这样理解有没有问题,谢谢了