PHP.nl

get_resource_type

get_resource_type

Returns the resource type

string **get_resource_type** resource $resource

This function gets the type of the given resource.

resourceThe evaluated resource handle.

If the given is a resource, this function will return a string representing its type. If the type is not identified by this function, the return value will be the string . resource``Unknown

This function will return null and generate an error if is not a . resource``resource

Voorbeeld: example

<?php
$fp = fopen("foo", "w");
echo get_resource_type($fp) . "\n";
?>
stream

get_resource_id