I've got a $_SESSION array which takes in user information (integer values) but some of the fields can be left blank. So I need to replace the blank elements in the array with zero (i.e. 0) so I can do some more processing.
Hope someone can help
foreach($arr as $key=>$val)
$arr[$key] = replaceWithZeroes($arr[$key]);
if ($val == '') $arr[$key] = 0;
$_SESSION = replaceWithZeroes($_SESSION);
Is that what you mean?
Why do you want this btw, sounds a bit hacky to me ...
Yeah thats what I mean. I'm just tryin to solve a small problem and I know bad practice to hack.
Thank you for your help