3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "This dude is a good man"; $bad = array('truck','shot','etc'); $flag='0'; foreach($bad as $word){ if(in_array($word,$string)) { $flag=1; } } if($flag==1) echo "Exist"; else echo "Not Exist";

preferences:
26.3 ms | 402 KiB | 5 Q