note 31932 added to function.main
| From: | nezbaq at rack1 dot php dot net | Date: | Fri, 09 May 2003 10:22:17 +0000 |
| Subject: | note 31932 added to function.main | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-47730@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
--
http://www.php.net/manual/en/function.main.php
http://master.php.net/manage/user-notes.php?action=edit+31932
http://master.php.net/manage/user-notes.php?action=delete+31932
http://master.php.net/manage/user-notes.php?action=reject+31932