I am currently using is_resource() to determine if a variable is an open file descriptor.
is_resource()
Is this right or is there an alternative (best) way to do this?
This can give you many false positives, such as database resources.
Instead, you should use get_resource_type .
get_resource_type