Proper code formatting
| From: | Angus Mann | Date: | Mon, 23 Mar 2009 06:19:02 +0000 |
| Subject: | Proper code formatting | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-290556@lists.php.net to get a copy of this message | ||
Hi all, I'm fairly new to PHP so I don't have too many bad habits yet.
I'm keen to make my code easy to read for me in the future, and for others as well.
Are there any rules or advice I can use for formatting (especially indenting) code?
for example how best to format / indent this ?
if ($variable = 'this')
{
do this;
and this;
}
else
{
if ($name = 'bill')
{
do something will bill;
and something else with bill;
}
else
{
assume its not bill;
and do the fred thing;
}
I'm using "PHP designer 2008" which does syntax coloring but if it has something to automatically indent - I haven't found it yet.