I am struggling to get the lowest value based on the answer of the client.
$client_answer = 28;
$array = array(10,20,30,40,50);
The answer that should be given is: 20
So every answer should be rounded down to the lower number.
Other examples:
$client_answer = 37;
$array = array(10,20,30,40,50);
answer should be 30.
$client_answer = 14;
$array = array(10,20,30,40,50);
answer should be 10.
$client_answer = 45;
$array = array(10,20,30,40,50);
answer should be 40.
Is there a php function that I can use for this?
If not how can this be accomplished?