I have a variable `$user_id` (number value)

Want to check if `$user_id` falls in between the range of 1 - 1000 or 1001 - 2000 or 2001 - 3000 .... 99001 - 100000

1. Is there a way to do this without writing 100 `switch` or `if` statements in PHP?
2. When it finds the match, execute a code.

I know while and for loops are required for this. But not able to code it properly.