constants in functions

From: Date: Tue, 28 Jan 2003 13:43:08 +0000
Subject: constants in functions
Groups: php.windows 
Request: Send a blank email to php-windows+get-18136@lists.php.net to get a copy of this message
if you look at, for example, htmlentities(), it can take a constant as argument (the quote_style parameter). How would you do this in a user define function? like this (?) : function foo($bar=0) { define("ALL",0); define("FIRSTHALF",1); define("SECONDHALF",2); switch ($bar) { case ALL: .... case FIRSTHALF: .... case SECONDHALF: .... } } foo(SECONDHALF); : bobo :

« previous php.windows (#18136) next »