I’m completely lost, I have this code:
$val = explode('?',$_POST['data']);
print_r($val);
foreach($val as &$v) {
//some code
}
and the result is this:
Array ( [0] => 1|1|41|1|1|1 [1] => 1|1|31|1|1|1 [2] => 1|1|21|1|1|3 )
Warning: Invalid argument supplied for foreach() in test.php on line 131
I really don’t get what I’m doing wrong…
PS actually I’ve added print_r only to see what was wrong, I don’t really need it
Your code is changing the
$valsomewhere in the foreach.This code runs fine, see code path: