PHP - check if range appears in variable?
I have a variable like this :
$test = "002,003,004,005,012,032,045";
I'd like to see if any number in a range of numbers appears in this string.
eg :if ($test == [010-015]) echo "found";
this would check the $test variable for any number of 010,011,012,013,014,015 and if any is found then echo found.
How do I do this ?
Only way I can think of is to loop through each number .. but there must be a better way !
Thanks
Answer
Solution:
hope this helps you