Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

<?
class widget
{
var $name;
var $length;
}


$thing = new widget;


if(is_object($thing))
{
print("thing is an object");
}
?>


boolean is_real(expression)


The is_real function is an alias for the is_double function.


boolean is_resource(variable)


This function returns TRUE if the given variable is a resource. A resource is an integer
used to identify a system resource. An example is the return value of fopen.


boolean is_string(expression)


The is_string function returns TRUE if the expression is a string, FALSE otherwise.


<?
$Greeting = "Hello";
if(is_string($Greeting))
{
print("Greeting is a string");
}
?>


boolean isset(variable)


The isset function returns TRUE if the variable has been given a value, or FALSE if the
variable has never been on the left side of a set operator. In other words, it tests that the
variable has been set with a value.


<?
if(isset($Name))
{

Free download pdf