❮ PHP Variable Handling Reference
Return the resource type:
<?php
$file = fopen("test.txt","r");
echo get_resource_type($file);
?>
Run Example »
The get_resource_type() function returns the type of a resource.
get_resource_type(
resource);
Parameter | Description |
---|---|
resource | Required. Specifies the resource to check |
Return Value: | The type as a string on success, if type is not identified it returns "unknown", if resource is not a resource it returns NULL and generates an error |
---|---|
Return Type: | String |
PHP Version: | 4.0.2+ |
PHP Changelog: | PHP 5.3: If resource is not a resource it returns NULL. Earlier, the returned value was FALSE |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!