If my formatted string is:
$range = '0|500|0.50';
How can I search if number (200) exists in range between 0 and 500?
Here is what I tried, if there is better idea tell me please
Exploding the range first?
$arr = explode('|', $range);
$min = min($arr);
$max = max($arr);
But I do not know how to progress from there? I even do not know how to exlcude the 3rd parameter from range 0.50 in this case. Can anyone give me a starting point? I basically want to run search for numbers against range (formatted that way with | delimiter)
Thanks!
Use array_pop() function to remove last element from array.
Then compare with min and max values…