以下是我的代码,其中我只面临一个难题,当我运行下面的脚本,然后由于比较失败$ flag不回声请让我知道如何解决这个问题?返回false不允许回声
$s = "iph4on comes";
$se = "4gb comes in iphone";
$f = 0;
$tf = explode(" ",$searching);
$ms= explode(" ",$search_in);
foreach($tf as $word)
{
if (!preg_match("/$word/i", $search_in))
//if (!strpos($search_in, $word));
return false;
}
{
$f = 1;
}
echo $f;
//Due to return flase above i am not echoing
echo "Comparison Failed";
没有代码将超出返回,这是正确的。修复:把你想要运行_before_返回的代码,或重排代码,以便之后发生返回。 – TheZ
如果这是一个函数内部,请发布整个事情。这是毫无意义的。 –