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

(singke) #1

print("Your Name is $Name");
}
else
{
print("I don't know your name");
}
?>


boolean settype(variable, string type)


The settype function changes the type of a variable. The type is written as a string and
may be one of the following: array, double, integer, object, string. If the type could
not be set, FALSE is returned.


<?
$myValue = 123.45;
settype($myValue, "integer");
print($myValue);
?>


string strval(expression)


The strval function returns its argument as a string.


<?
$myNumber = 13;
print(strval($myNumber));
?>


unset(variable)


The unset function destroys a variable, causing all memory associated with the variable
to be freed.


<?
$list[0] = "milk";
$list[1] = "eggs";
$list[2] = "sugar";


unset($list);


if(!isset($list))
{
print("list has been cleared and has ");

Free download pdf