Easy Tutorial
❮ Func Ftp Rename Func String Nl Langinfo ❯

PHP get_resource_type() Function

PHP Available Functions

getresourcetype() 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:

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 occur.

Example

<?php
$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

❮ Func Ftp Rename Func String Nl Langinfo ❯