关于运算符的问题。为毛这样?
- PHP code
<!---ecms Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->if($item[$column_name] .$operation. $info) { echo $item[$column_name] .$operation. $info;echo '=====true';echo '<br>'; return true; }else{ echo $item[$column_name] .$operation. $info;echo '=====false';echo '<br>'; return false; }输出:508205462=505765854=====true10>1234567=====true201234567)<em style="color:transparent">本@文来源[email protected]搞@^&代*@码网(</em><q>搞代gaodaima码</q>返回假,用程序运算出来全部为真??
——解决方案——————–
因为有“.”,所以你那些变量当做字符串连接起来了
如果想让他们当做表达式运算,需用 eval 函数
eval(‘return ‘. $item[$column_name] .$operation. $info. ‘;’)