<?php

$valor = 15840;

$faixas = [
   [5000, .41],
   [10000, .42],
   [15000, .43],
   [20000, .44],
   [25000, .5],
   [30000, .57]
];

if($valor > end($faixas)[0] || $valor < 1){
   $porcentagem = 5;
}else{
   foreach($faixas as $v){
      if($valor <= $v[0]){
         $porcentagem = $v[1];
         break;
      }
   }
}

echo $porcentagem;