$mostmatched = function( $input to test, $array with given values)
The array contains diffrent numbers (10,30,50 ...) and I give an input (13) and the desired function should return the nearest value in the array (10).
Is there already a function like this? Else: Any suggestions how to achieve that?