★ wanayoo — archive 1999 http://www.php.net/manual/function.is-resource.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Variables
Quick Reference
German version of this pageJapanese version of this pageItalian version of this pageHungarian version of this page
Variables
* call_user_func
* doubleval
* empty
* gettype
* intval
* is_array
* is_bool
* is_double
* is_float
* is_int
* is_integer
* is_long
* is_numeric
* is_object
* is_real
* is_resource
* is_string
* isset
* print_r
* settype
* strval
* unset
* var_dump
Manual: is_resource
View the source code for this pageSearch the site



Previous page
 is_real
 Updated
Sat, 12 Aug 2000
is_string 
Next page


is_resource

(PHP4 >= 4.0b4)

is_resource --  Finds whether a variable is a resource

Description

int is_resource (mixed var)

is_resource() returns true if the variable given by the var parameter is a resource, otherwise it returns false.

Resources are things like file or database result handles that are allocated and freed by internal PHP functions and that may need some cleanup when they are no longer in use but haven't been freed by user code.


User Contributed Notes: is_resource


ccjeagle@ms6.hinet.net
08-Aug-2000 10: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".



 About Notes


Previous page
 is_real
 Updated
Sat, 12 Aug 2000
is_string 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.