我要检查的preg_match多$线检查结果...这里是我的代码多的preg_match以多行
$line = "Hollywood Sex Fantasy , Porn";
if (preg_match("/(Sex|Fantasy|Porn)/i", $line)){
echo 1;}else {echo 2;}
现在我想在很多检查喜欢就好
$line = "Hollywood Sex Fantasy , Porn";
if (preg_match("/(Sex|Fantasy|Porn)/i", $line, $line1, $line2)){
echo 1;}else {echo 2;}
一些事情
像上面的代码与$line1 $line2 $line3
你是如何得到'$ line1'和'$ line2'?你可以把一切都放在一个单独的字符串中。 –
@Jack我正在用$ like和$ line1检查不同的东西,比如名称,流派等...所以我想检查这些东西并给出输出会计 – Harinder
正则表达式是否应匹配所有行或任何行? –