note 31932 deleted from function.main by sniper
| From: | sniper@php.net | Date: | Tue, 13 May 2003 21:07:52 +0000 |
| Subject: | note 31932 deleted from function.main by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-47923@lists.php.net to get a copy of this message | ||
Heres a little info..
main() is a function in C/C++, which the PHP core is written in. In the PHP language itself, there
is no main() function, and the most external part of your script (not inside any other functions,
etc) can be considered as your main() function.
Take for example:
<?php
// Right now we are considered to be in main()
$a = 5;
$b = 5;
function add_ab($passed_a, $passed_b) {
// Out of main() for now
$passed_a += $passed_b;
return $passed_a;
}
// Back in main()
echo add_ab($a, $b);
?>
Maybe it will clear up any doubts.
P.S. E-Mail Address Partly ROT-13 Encoded