Note Submitter:
----
I typically use serialize() to store arrays in constants.
<?php
$value = array('Jim','Bob','Rebecca','Cooter');
define('CONSTANT',serialize($value));
?>
And unserialize as needed.
<?php
$name = 'Bob';
if(in_array($name,unserialize(CONSTANT)))
{
# Do something
}
?>
Didn't see this mentioned here - simple approach, allows
for constant arrays without a ton of overhead.
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|