Created
April 12, 2018 12:47
-
-
Save radheymkumar/c7043dc9e993bf55ed9261431f348a00 to your computer and use it in GitHub Desktop.
get even and odd value in array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print_r(array_filter($numbers, 'isPositive')); | |
function isPositive($val) { | |
//return ($val > 50) ? true : false; | |
if($val%2 == 1) { | |
return $val; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment