PHP - 使用 strpos 查找返回错误结果的 Sting

PHP - Using strpos To Find a Sting Returning Wrong Result

我使用 Strpos 得到了一个奇怪的结果 -

$tmp 变量正在从 Mysql Table 中提取所有字段结果。为简单起见,我将缩短为这个变量

$tmp = "As Chat Buddies, Through Personal Email, Through Text Messaging" ;

Var_dump $tmp 将显示上面的例子..

我正在使用这个命令..

if (($label == 'Communication') AND (strpos($tmp, 'As Chat Buddies') !== 'false') )
        {
            $tmp .= '&nbsp;<img src="http://www.test.com/image/chat.jpg">';

            }

这有效并在右侧显示图像。

这个问题是..顺序中的下一个命令(以及任何其他命令)...

if (($label == 'Communication') AND (strpos($tmp, 'In Real Life') !== 'false') )
        {
            $tmp .= '&nbsp;<img src="http://www.test.com/image/real.jpg">';

            }

也会显示..即使它不在字符串中的任何地方?不管怎样,它都返回有效。

有什么建议吗?

false 应该是常量,而不是引用的字符串正如上面提到的@markbaker