salve!
devo effettuare due la funzione array_search cercando lo stesso valore, ma in array diversi:
Codice PHP:
for ($i = 0; $i < count($_POST['articolo_id']); $i++) {
if (array_search($_POST['articolo_id'][$i], $_POST['new']) !== false) {
$new = 1;
} else {
$new = 0;
}
if (array_search($_POST['articolo_id'][$i], $_POST['abilitato']) !== false) {
$ab = 1;
} else {
$ab = 0;
}
// DO STUFF
}
quei due if presi singolarmente funzionano, ma presi insieme mi danno questo errore:
codice:
Warning: array_search() [function.array-search]: Wrong datatype for second argument.....
perchè??
inoltre pare che cmq funzioni tutto anche con quell'errore.