On Tue, 25 Sep 2001 17:46, Bård Tommy Nilsen wrote:
> Can you write me an short example ??
>
>
> Bård Tommy Nilsen
[About passing arguments to functions and global scoping]
Declaring $id global:
function doit() {
global $id;
echo $id;
}
$id = 1;
doit();
output is 1
Passing $id as parameter:
function doit($input) {
echo $input;
}
$id = 1;
doit($id);
output is 1
See the sections of the manual on Functions and variable scope for more
information.
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
printf("to C or not to C...that is the question/n");
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]