Miscellaneous
|
|
|
|
<?php // Data Object Types
define('OBJECT_TYPE_USER', 1);
define('OBJECT_TYPE_CONTACT', 2);
function &get_object_types()
{
static $data = null;
if ($data === null) // initialization on first call
{
$data = array(
OBJECT_TYPE_USER => 'User',
OBJECT_TYPE_CONTACT => 'Contact'
);
}
return $data;
} ?>
|
|
|
Usage Example
|
if (isset($_POST['type']))
{
$flags = $_POST['type'];
$a =& get_object_types();
echo 'This is a ', $a[$otype],' type.';
|
|
|
Rate This Script
|
|
|
|