Re: Function/globalizing
| From: | Joel Colombo | Date: | Sun, 16 Mar 2003 19:44:37 +0000 |
| Subject: | Re: Function/globalizing | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139861@lists.php.net to get a copy of this message | ||
Try:
somewhere global define :
$encryptiontechnique = 'ENCRYPT ALGORITHM';
function encryptPassword($password, $salt='') {
global $encryptiontechnique; if ($salt === '') { $salt =
$encryptiontechnique; }
// CODE......
}
Joel Colombo
"Liam Gibbs" <liamgibbs@sympatico.ca> wrote in message
news:00d501c2ebf2$2cc3d600$4d59fea9@TeletranOne...
I have a function, such as this:
function encryptPassword($password, $salt = $encryptiontechnique) {
}
$encryptiontechnique is defined, obviously outside the function. How is it
possible to make $encryptiontechnique global so that this will work?