note 87292 added to function.main

From: Date: Fri, 28 Nov 2008 14:09:18 +0000
Subject: note 87292 added to function.main
Groups: php.notes 
Request: Send a blank email to php-notes+get-147066@lists.php.net to get a copy of this message
In an effort to separate PHP code as much as possible from the HTML code I use the following self-enforced standard: * all PHP functions are above the <!DOCTYPE> or <HTML> * the last function in the list in the PHP block is a function called main() * within the <BODY> element the first thing I do to initialize the page is to make a call to the main function This results in code looking like this: <?php function xxx() { } function yyy() { } function main() { xxx() // execute call to other function } ?> <HTML> <BODY> <?php main() ?> </BODY> </HTML> This way I hope my code will be readable for newbies and advanced programmers. ---- Server IP: 193.190.67.11 Probable Submitter: 193.190.172.132 ---- Manual Page -- http://www.php.net/manual/en/function.main.php Edit -- https://master.php.net/note/edit/87292 Del: integrated -- https://master.php.net/note/delete/87292/integrated Del: useless -- https://master.php.net/note/delete/87292/useless Del: bad code -- https://master.php.net/note/delete/87292/bad+code Del: spam -- https://master.php.net/note/delete/87292/spam Del: non-english -- https://master.php.net/note/delete/87292/non-english Del: in docs -- https://master.php.net/note/delete/87292/in+docs Del: other reasons-- https://master.php.net/note/delete/87292 Reject -- https://master.php.net/note/reject/87292 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#147066) next »