Can someone explain to me why you can\'t pass a key as reference?
Ex:
if(is_array($where)){
foreach($where as &$key => &$value){
why is it a problem to do that? Make it a function. A function takes an input and gives an output. Your function input will be your "unsecured" array. Your output will be the result of securing the array.
Then you just do
$where = secureMyArray($where);
That's why you have the ability to make functions...