|
Posted by Toby A Inkster on 08/02/07 08:44
Yarco wrote:
> But cause $MONTH_NAMES is variable, someone could change the value.
If you overload the class' __set() function you can effectively make it
read-only. (Assuming you're using PHP 5.)
Better though:
function get_month_name ($n, $fmt='M')
{
$d = mktime(12, 0, 0, $n, 1, 1970);
return date($fmt, $d);
}
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 42 days, 12:20.]
PHP Encryption Class
http://tobyinkster.co.uk/blog/2007/08/01/php-encryption-class/
[Back to original message]
|