note 109761 deleted from function.define by cmb

From: Date: Sun, 06 Oct 2019 07:47:01 +0000
Subject: note 109761 deleted from function.define by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-212467@lists.php.net to get a copy of this message
Note Submitter: New Social Life ---- I want to show you how to define multiple things at once just use this small function: ( i'm trying to do it even smaller... but i think is small enough ) <?php function …define($a){foreach($a as $k => $v)define($k, $v);} ?> usage example: <?php …define(array( "second" => 1, "minute" => 60, "hour" => 3600, "day" => 86400, "week" => 604800, "month" => 2592000, // 30 days month "year" => 31536000, "year2" => 31622400 )); ?> PLEASE NOTE: there AREN'T three points, there is the three points CHARACTER, to be sure, just copy paste my code

« previous php.notes (#212467) next »