I have a string and I need to find out whether it is a unix timestamp or not, how can I do that effectively?
I found this thread via Google, but it doesn\'t come up
This doesn't account for negative times(before 1970), nor does it account for extended ranges(you can use 64 bit integers so that a timestamp can represent a value far after 2038)
$valid = ctype_digit($str) && $str <= 2147483647;