Is there a way to test a range without doing this redundant code:
if ($int>$min && $int<$max)
?
Like a function:
I don't think you'll get a better way than your function.
It is clean, easy to follow and understand, and returns the result of the condition (no return (...) ? true : false mess).
return (...) ? true : false