Search DaTutorials:  
HOME
Php Tutorials
Articles
Basics
Date and Time
File Manipulations
Forms
Functions
General
Interactivity
MySql
Navigation
News,Shoutboxes and Blogs
Language Structure and Data Types
Searching
Security
String Manipulation
User Information and Stats
Search For a Tutorial
Php Reference

is_resource

(PHP 4 , PHP 5)

is_resource --  Finds whether a variable is a resource

Description

bool is_resource ( mixed var)

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

Example 1. using is_resource()

<?php

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

?>

See the documentation on the resource-type for more information.



Copyright © 2001-2004 The PHP Group
All rights reserved.

     Destin, Florida | eHarmony Coupon | Remortgages | Gas Suppliers | Hotels in Europe
Home     Link To Us     Ad With Us     Contact Us     Tell A Friend     Affiliates     Blog     MsOfficeHelp