[Solved] Increase the speed of this code? Foreach


Might be slightly faster, I haven’t tested, but if ['Data']['Show'] will be true or false then this is how I would do it:

$pass = array_filter($var, function($v) { return $v['Data']['Show']; });

If it could be other values that evaluate to false then:

$pass = array_filter($var, function($v) { return $v['Data']['Show'] !== false; });

solved Increase the speed of this code? Foreach