downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<is_realis_scalar>
Last updated: Thu, 26 Jun 2008

is_resource

(PHP 4, PHP 5)

is_resource — Finds whether a variable is a resource

Description

bool is_resource ( mixed $var )

Finds whether the given variable is a resource.

Parameters

var

The variable being evaluated.

Return Values

Returns TRUE if var is a resource, FALSE otherwise.

Examples

Example #1 is_resource() example

<?php

$db_link
= @mysql_connect('localhost', 'mysql_user', 'mysql_pass');
if (!
is_resource($db_link)) {
   die(
'Can\'t connect : ' . mysql_error());
}

?>



add a noteadd a note User Contributed Notes
Finds whether a variable is a resource
There are no user contributed notes for this page.




<is_realis_scalar>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs