I'm passing a PDO prepare parameter array into the foreach statement so that I can modify the data. I'm modifying some data based on the prefix. Here's the example from my code:
foreach($param as $key => $t)
{
if(strpos($key,"int")===0)
{
$t = (int) $param[$key];
$key = str_replace("int","",$key);
unset($param[$key]);
$param[$key] = $t;
}
}
I'm not sure how to unset those array elements with int as prefix, and I can't execute query because of PDO error:
Invalid parameter number: number of bound variables does not match number of tokens