So lets say I have an string like so.
$pizza = 1,2,3,5-4,7;
and what I want to get out of it is the 5-7 out of that set but that 5-7 could be any combo, say 6-9 or 10-1 and this occur multiple times.
Such as
$pizza=1-4,2,3-1,5-4,7;
So how would I go about that?
I understand how to get rid of the commas by explode and implode but then I don’t know how to get the dashed numbers and the position of those numbers in the string.
That should do it