正如您在输出中看到的,stripos 无法捕获 _formtoken 值,任何人都可以通过解决方案向我解释:
$value = ['_formtoken','expiry','version','pan','expiry','purchAmount','_formtoken','pan'];
for($i=0;$i<count($value);$i++){
if (stripos($added, $value[$i]) == false) {
echo $value[$i] . ' => Not exists in <br>';
$added .= $value[$i];
}
else {
echo $value[$i] . ' => already exists <br>';
}
}
输出 :
_formtoken => Not exists in
expiry => Not exists in
version => Not exists in
pan => Not exists in
expiry => already exists
purchAmount => Not exists in
_formtoken => Not exists in
pan => already exists
慕雪6442864
杨__羊羊