I need to parse a string to two variables according to the following rules, and I'm looking for the best way to achieve this in PHP:
"40.3" -> minval=40.3, maxval=40.3
"-40.3" -> minval=-40.3, maxval=-40.3
"40.3-60.76" -> minval=40.3, maxval=60.76
"-40.3-60.76" -> minval=-40.3, maxval=60.76
"-60.76--40.3" -> minval=-60.76, maxval=-40.3
Unfortunately I have to use minus both for negative values, as well as range separator.
This is pretty similar to my previous question:
(I already once posted this second question but noticed that I had messed the table. Hopefully it's fine now.)