Question: I'm kinda of new in android. How can i send an email automatically without a contact chooser. 
I write a list of e-mails in edittext and an message and then i want to send to every email address. 
How can i do that?

Answer: 
Is `array_filter` is the method your looking for. I guess there are enough ways to do this :)

```
$array = [0, 15, 60, 120, 2200];
$number = 15;
$filtered = array_filter($array, function($element) use ($number) {
   return ($element <= $number);
});
// $filtered = [0, 15];

$max = max($filtered); //15

```
You can search from the end **if the array is sorted correctly**, it's more simple to just find the first value no more than $number and return it.

```
$result = false;
foreach(array_reverse($arr) as $v)
{
  if($v <= $number)
  {
      $result = $v;
      break;
  }
}
if($result !== false)
  echo $result;

```