超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<is_realis_scalar>
Last updated: Fri, 22 Jun 2007

is_resource

(PHP 4 , PHP 5)

is_resource --  检测变量是否为资源类型

描述

bool is_resource ( mixed var)

如果给出的参数 varresource 类型,is_resource() 返回 TRUE,否则返回 FALSE

查看 resource 类型文档获取更多的信息。




add a note add a note User Contributed Notes
is_resource
ccjeagle at ms6 dot hinet dot net
09-Aug-2000 01:15
// A simple example:
$fp = fopen("my.txt","r") ;
echo gettype($fp) ;
print is_resource($fp) ? "TRUE" : "FALSE" ;
fclose($fp) ;

// Another example
$fp = fopen("my.txt","r") ;
fclose($fp) ;
echo gettype($fp) ;
print is_resource($fp) ? "TRUE" : "FALSE" ;

Both return "resource" and "TRUE".

<is_realis_scalar>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22