Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP is_resource() Function

PHP is_resource() Function

PHP Available FunctionsAvailable PHP Functions

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:

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:



文件打开成功...

PHP Available FunctionsAvailable PHP Functions