PHP Optimization
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
PHP Optimization
Is anyone willing to provide a short list of hints and tips to keep your PHP scripts running as fast and reliably as possible?
How to..
Better minds than mine have already answered:
http://phplens.com/lens/php-book/optimi ... ng-php.php
http://phplens.com/lens/php-book/optimi ... ng-php.php
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Does anyone know if reducing the number of echo's is faster or sloppier?
For example:
compared to
For example:
Code: Select all
echo '<table>';
echo '<tr>';
echo '<td>';
echo 'Some text';
echo '</td>';
echo '</tr>';
echo '</table>';Code: Select all
echo '<table>
<tr>
<td>
Some text
</td>
</tr>
</table>';- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Oh and another question....
When I'm writing my php code I just use windows notepad. It's not particularly friendley for debbugging even when the code is nicely laid out.
On this forums php code is shown nicely color coded which makes things easier.
Anyone know of any software which lets you write your php so that it's viewable in color coded form like on this forum?
When I'm writing my php code I just use windows notepad. It's not particularly friendley for debbugging even when the code is nicely laid out.
On this forums php code is shown nicely color coded which makes things easier.
Anyone know of any software which lets you write your php so that it's viewable in color coded form like on this forum?
im using Macromedia Dreamweaver MX 2004, its qite nice but not free.
Im sure you will find something usefull here http://www.thelinuxconsultancy.co.uk/ph ... /index.php
Im sure you will find something usefull here http://www.thelinuxconsultancy.co.uk/ph ... /index.php
- MarK (CZ)
- Forum Contributor
- Posts: 239
- Joined: Tue Apr 13, 2004 12:51 am
- Location: Prague (CZ) / Vienna (A)
- Contact:
I use ActiveState Komodo (http://www.activestate.com/). Paid, but good.
Anyway, you can highlight the code using php via functions highlight_file or highlight_string.
Anyway, you can highlight the code using php via functions highlight_file or highlight_string.
My editor
I use Crimson Editor...free
Also has no shareware messages, just pure, unadultered, old-fashioned freeware. 
Go to http://www.crimsoneditor.com
Color-codes for many diff. types of code, including PHP, ASP, Perl, and HMTL. Defaults are diff. colors than this site or php.net uses, but those are adjustable. Also, it automatically indents all lines between { and }...good for those of us that don't want to take the time to manually indent.
Go to http://www.crimsoneditor.com
Color-codes for many diff. types of code, including PHP, ASP, Perl, and HMTL. Defaults are diff. colors than this site or php.net uses, but those are adjustable. Also, it automatically indents all lines between { and }...good for those of us that don't want to take the time to manually indent.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
In some php references i read, the following ways is much faster than both of your ways because php will never spend time to parse them, e.g. :d11wtq wrote:Does anyone know if reducing the number of echo's is faster or sloppier?
Code: Select all
<?
some php codes ....
...
?>
<table>
<tr>
<td>Some text
</td>
</tr>
</table>
<?
some php codes
..
?>