RE: [PHP-WIN] php defining variable defaults? From: FARRINGTON, RYAN (ryan.farrington <email protected>)
Date: 02/13/03

that is exactly what I was looking for!!! =) Thank you very much!

-----Original Message-----
From: Matt Hillebrand [mailto:matt <email protected>]
Sent: Thursday, February 13, 2003 4:21 PM
To: php-windows <email protected>
Subject: RE: [PHP-WIN] php defining variable defaults?

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 <email protected>]
|Sent: Thursday, February 13, 2003 4:12 PM
|To: 'php-windows <email protected>'
|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?
|
|

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php