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://codercto.com/courses/l/5.html

查看所有标签

The Tangled Web

The Tangled Web

Michal Zalewski / No Starch Press / 2011-11-26 / USD 49.95

"Thorough and comprehensive coverage from one of the foremost experts in browser security." -Tavis Ormandy, Google Inc. Modern web applications are built on a tangle of technologies that have been de......一起来看看 《The Tangled Web》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换