August 2003
Intermediate to advanced
1104 pages
19h 27m
English
These functions check the status of a variable, change its type, or return a value as a particular data type.
Use constant (Listing 11.1) to fetch the value of a constant. This offers the ability to specify a constant with a variable.
<?php
function getDatabaseProperty($property)
{
return(constant("DATABASE_$property"));
}
define("DATABASE_HOST", "localhost");
define("DATABASE_USER", "httpd");
define("DATABASE_PASSWORD", "");
define("DATABASE_NAME", "freetrade");
print(getDatabaseProperty('HOST'));
?>
|
The ctype_alnum function tests whether every character in the given string is in the set of all digits and letters, ...
Read now
Unlock full access