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

查看所有标签

Learn Python the Hard Way

Learn Python the Hard Way

Zed Shaw / Example Product Manufacturer / 2011

This is a very beginner book for people who want to learn to code. If you can already code then the book will probably drive you insane. It's intended for people who have no coding chops to build up t......一起来看看 《Learn Python the Hard Way》 这本书的介绍吧!

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

在线压缩/解压 CSS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

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

HTML 编码/解码