RE: [PHP] Hmmm?
| From: | Lawrence dot Sheed at dfait-maeci dot gc dot ca | Date: | Wed, 01 Aug 2001 08:05:49 +0000 |
| Subject: | RE: [PHP] Hmmm? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-60582@lists.php.net to get a copy of this message | ||
I presume you mean code layout
Its there to make code easier to read.
eg some silly code
for ($x=1;$x<100;$x++) {
while ($i<50) {
print $i;
}
}
This is more legible than
for ($x=1;$x<100;$x++) {
while ($i<50) {
print $i;
}
}
Indentation makes it easier to spot where your code constructs - if ,switch,
while etc start and end.
Hope that explains it a little. Do a search for code layout in google, and
read up on it, and check out a few examples. There are a number of coding
styles, find one that you like, and be consistent. Remember to also comment
your code, as well as making it presentable. If you look back at old code
in a few years time you'll be grateful you did.
Cheers,
Lawrence.
-----Original Message-----
From: Kyle Smith [mailto:dbzno1fan@hotmail.com]
Sent: August 1, 2001 11:42 PM
To: php-general@lists.php.net
Subject: [PHP] Hmmm?
Whenever i get a php script off a website why is it that most of the main
parts in the script have a space from the left border. eg
<?php
echo"spazzzzzzz";
?>
????
-lk6-
http://www.StupeedStudios.f2s.com
Home of the burning lego man!
ICQ: 115852509
MSN: dbzno1fan@hotmail.com
AIM: legokiller666