Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$nopa = "Shotgun"; $weapon1 = array("Ingen","Shotgun","Glock 17","Revolver","AK 47","Barrett M82");
$weapon が $nopa と等しい場合、このコードは yes を出力し、そうでない場合は no を出力します。何か案は?
これはあなたが望むものです:
<? $nopa = "Shotgun"; $weapon1 = array("Ingen","Shotgun","Glock 17","Revolver","AK 47","Barrett M82"); if (in_array($nopa,$weapon1)){ echo 'YES'; } else { echo 'NO'; } ?>
作業コード