PHP is_resource() Function
is_resource() The function is used to check whether a variable is of resource type.
PHP version requirement: PHP 4, PHP 5, PHP 7
Syntax
bool is_resource ( mixed $var )
Parameter Description:
- $var: the variable to check.
Return Value
If the specified variable is of resource type, is_resource() returns TRUE; otherwise returns FALSE.
Example
In the following example, you need to create a demo.txt file in the current directory.
Example
The output is:
文件打开成功...
Available PHP Functions