Skip to content

Instantly share code, notes, and snippets.

@shameerc
Created December 26, 2010 08:03
Show Gist options
  • Select an option

  • Save shameerc/755295 to your computer and use it in GitHub Desktop.

Select an option

Save shameerc/755295 to your computer and use it in GitHub Desktop.
Array filter function using lambda function
<?php
$time = array('morning', 'noon');
array_filter($time, function($a){
if($a=='noon')
echo 'Its lunch time';
else
echo "Its time for breakfast";
}
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment