Re: PHP_SELF or REQUEST_URI within Function ?
| From: | Alexander Skwar | Date: | Fri, 31 Aug 2001 15:40:51 +0000 |
| Subject: | Re: PHP_SELF or REQUEST_URI within Function ? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-65518@lists.php.net to get a copy of this message | ||
So sprach »Arcadius A.« am 2001-08-31 um 17:36:51 -0700 :
> Would this work ?
Kinda, but not really.
If you want to do this, you've got to stuff it all in one function, like
so:
function dunno($mandatory, $optional1 = NULL, $opt2 = NULL){
if (NULL === $optional1){
// behave, as if only $mandatory is set
echo 'mandatory is: ' . $mandatory;
return;
}
if (NULL === $optional2){
// behave, as if $man. and $opt1 have set
echo 'mand is : ' . $mandatory;
echo 'opt1 is : ' . $optional1;
return;
}
// neither $opt1 nor $opt2 are null
echo 'mand is : ' . $mandatory;
echo 'opt1 is : ' . $optional1;
echo 'opt2 is : ' . $opt2;
return;
}
Alexander Skwar
--
How to quote: http://learn.to/quote (german) http://quote.6x.to (english)
Homepage: http://www.digitalprojects.com | http://www.iso-top.de
iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 2 days 2 hours 31 minutes