= 4.0.2, PHP 5, PHP 7 sintassi string get_resource_type ( resource" />



English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Tutorial di base PHP

Tutorial avanzato PHP

PHP & MySQL

Manuale di riferimento PHP

Uso e esempio della funzione PHP get_resource_type()

PHP 可用的函数

get_resource_type() Restituisce il tipo di risorsa (risorsa).

Requisiti di versione: PHP 4 >= 4.0.2, PHP 5, PHP 7

Sintassi

string get_resource_type ( resource $handle )

Spiegazione dei parametri:

  • $handle: gestore.

Valore di ritorno

Questa funzione restituisce una stringa che rappresenta il tipo di risorsa passata al suo interno. Se il parametro non è una risorsa valida, viene generato un errore.

Esempio online

<?php
$c = mysql_connect();
echo get_resource_type($c) . PHP_EOL;
// Stampa: collegamento mysql
$fp = fopen("foo","w");
echo get_resource_type($fp) . PHP_EOL;
// Stampa: file
$doc = new_xmldoc("1.0");
echo get_resource_type($doc->doc) . PHP_EOL;
// Stampa: documento domxml
?>

PHP 可用的函数