PHP get_resource_type() 函数

PHP 教程 · 2019-01-31 15:44:49

get_resource_type() 返回资源(resource)类型。

版本要求:PHP 4 >= 4.0.2, PHP 5, PHP 7

语法

string get_resource_type ( resource $handle )

参数说明:

  • $handle:句柄。

返回值

此函数返回一个字符串,用于表示传递给它的 resource 的类型。如果参数不是合法的 resource,将产生错误。

实例

实例

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

点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html

查看所有标签

Chinese Authoritarianism in the Information Age

Chinese Authoritarianism in the Information Age

Routledge / 2018-2-13 / GBP 115.00

This book examines information and public opinion control by the authoritarian state in response to popular access to information and upgraded political communication channels among the citizens in co......一起来看看 《Chinese Authoritarianism in the Information Age》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码