Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php filter array

$numbers = [-2, 4, -6, 8, 10];

function isPositive($number)
{
  return $number > 0;
}

$filteredArray = array_filter($numbers, "isPositive");
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #php #filter #array
ADD COMMENT
Topic
Name
4+1 =