filter in php array of objects code example
Example: php filter array
$numbers = [-2, 4, -6, 8, 10];
function isPositive($number)
{
return $number > 0;
}
$filteredArray = array_filter($numbers, "isPositive");
$numbers = [-2, 4, -6, 8, 10];
function isPositive($number)
{
return $number > 0;
}
$filteredArray = array_filter($numbers, "isPositive");