$c = '4432';$word = file_get_contents('1234.txt');$value = explode(" ",$word);for ($i = 0; $i < 3; $i++) { if ($value[$i] = $c){ echo $value[$i]; break; }}文件1234.txt內(nèi)容:1234 789 4432 9985532 999如何比較4432并分別得到值789?我需要:if $c is 1234 then get 789 valueif $c is 4432 then get 998 valueif $c is 5532 then get 999 value現(xiàn)在我的代碼只能得到 1234 或 4432 或 5532。
php txt 字符串比較數(shù)組比較
炎炎設(shè)計(jì)
2023-05-26 17:43:39