In my code, I fill an array using this line in a loop :
$_SESSION['my_array'][] = $some_value;
After each execution of this line, I do some check (doesn't matter here for which purpose) using the function in_array()
. However, at the first iteration it says :
« in_array() expects parameter 2 to be array ».
How to fix this problem?