PHP get_resource_type() Function
get_resource_type()Returns the type of a resource.
Version requirements: PHP 4 >= 4.0.2, PHP 5, PHP 7
Syntax
string get_resource_type ( resource $handle )
Parameter description:
- $handle: The handle.
Return Value
This function returns a string representing the type of the resource passed to it. If the parameter is not a valid resource, an error will be raised.
Example
Example
$c = mysql_connect();
echo get_resource_type($c) . PHP_EOL;
//Prints: mysql link
$fp = fopen("foo","w");
echo get_resource_type($fp) . PHP_EOL;
//Prints: file
$doc = new_xmldoc("1.0");
echo get_resource_type($doc->doc) . PHP_EOL;
//Prints: domxml document
PHP Available Functions