Voting

: seven plus two?
(Example: nine)

The Note You're Voting On

mackstann / mack%at%incise%dot%org
21 years ago
I find the ["count"] items in these arrays highly annoying, so I made a function to remove them recursively:

function rCountRemover($arr) {
foreach($arr as $key=>$val) {
# (int)0 == "count", so we need to use ===
if($key === "count")
unset($arr[$key]);
elseif(is_array($val))
$arr[$key] = rCountRemover($arr[$key]);
}
return $arr;
}

<< Back to user notes page

To Top