Php determines if a variable is an open file manuscript

I am currently using is_resource() to determine if a variable is an open file descriptor.

Is this right or is there an alternative (best) way to do this?

+8
php
source share
1 answer

This can give you many false positives, such as database resources.

Instead, you should use get_resource_type .

+5
source share

All Articles