PHP is_resource() Function

PHP Variable Handling Reference : Check whether a variable is a resource or not

Definition and Usage

The is_resource() function checks whether a variable is a resource or not.

Note: The is_resource() function will return FALSE if the resource has been closed.

This function returns true (1) if the variable is a resource, otherwise it returns false/nothing.

Syntax

is_resource(variable);

Parameter Values

Parameter Description
variable Required. Specifies the variable to check

Technical Details

Return Value: TRUE if variable is a resource, FALSE otherwise
Return Type: Boolean
PHP Version: 4.0+

❮ PHP Variable Handling Reference