i have this array, and all i want it to do is cycle through and just remove certain elements that appear in the if, however whenever i output the array it always just shows
array(0) { }
instead of
["addon_h_id"]=> string(1) "1"
Here is the code which cycles through it, if i remove this code then the array displays as normal
foreach ($new_shopping_array as $columnName => $columnData) {
if($columnName == "s_list_id" || "user_id"){
unset($new_shopping_array[$columnName]);
}
}
Thanks for any and all help
Operator precedence: You’re doing $columnName = “s_list_id”, then ORing the result of that against “user_id”