RE: [PHP-WIN] php defining variable defaults?

From: Date: Thu, 13 Feb 2003 22:20:55 +0000
Subject: RE: [PHP-WIN] php defining variable defaults?
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-18533@lists.php.net to get a copy of this message
You could do if(!isset($var)) $var = 'asdf'; Or if you're using a function, you can specify default values in the parameter list: function my_func($var1 = 'default1', $var2 = 'default2') { // do stuff // do stuff } Matt |-----Original Message----- |From: FARRINGTON, RYAN [mailto:ryan.farrington@cingular.com] |Sent: Thursday, February 13, 2003 4:12 PM |To: 'php-windows@lists.php.net' |Subject: [PHP-WIN] php defining variable defaults? | | |ok cold fusion has the ability to do a <cfparam name='' default=''> | |this lets you specify a variable name to be defaulted to a |value if it is called without being defined. I usually use |this for variables specified by forms either by GET or POST. |now I can't find it's equivalent in PHP.. can anyone direct me |in the correct direction? | |

« previous php.windows (#18533) next »