array array_filter ( array arr [, function callback] )
function endswithy($value) {
return (substr($value, -1) == 'y');
}
$people = array("Johnny", "Timmy", "Bobby", "Sam", "Tammy", "Joe");
$withy = array_filter($people, "endswithy");
var_dump($withy);
?>