Author Topic: PHP Coding Guidle lines.  (Read 939 times)

0 Members and 1 Guest are viewing this topic.

Offline paragkalraTopic starter

  • Irregular
  • Posts: 29
  • Gender: Male
    • View Profile
    • paragkalra.com
PHP Coding Guidle lines.
« on: April 25, 2009, 03:11:28 AM »
Hello All,

I was looking for PHP Coding guidle lines.

Could someone please share some online URL specifying the best coding practices to be followed while coding in PHP?

Cheers,
Parag
Parag.A.Kalra, The Linux Man
http://www.paragkalra.com/
In this world without WALLS and GATES who need WINDOWS! USE LINUX! STOP PIRACY! GO OPEN SOURCE!

Offline Mchl

  • Staff Alumni
  • Freak!
  • *
  • Posts: 8,582
  • Gender: Male
  • That's Largo in my avatar, not me.
    • View Profile
    • FlingBits
Re: PHP Coding Guidle lines.
« Reply #1 on: April 25, 2009, 03:20:33 AM »
It largely depends on preference. Here's just an example:
http://framework.zend.com/manual/en/coding-standard.html
NetBeans fanatic | ExtJS masochist | C++ denier
PHP4 & MySQL4 are no longer supported.
PHPFreaks Tutorials | PHP Debugging: A Beginner's guide | PHP Security Tutorial || How To Ask Questions The Smart Way
Flingbits tutorials | Class Autoloading

Offline paragkalraTopic starter

  • Irregular
  • Posts: 29
  • Gender: Male
    • View Profile
    • paragkalra.com
Re: PHP Coding Guidle lines.
« Reply #2 on: April 25, 2009, 05:36:38 PM »
Thanks...
Parag.A.Kalra, The Linux Man
http://www.paragkalra.com/
In this world without WALLS and GATES who need WINDOWS! USE LINUX! STOP PIRACY! GO OPEN SOURCE!

Offline coalgames

  • Irregular
  • Posts: 22
    • View Profile
Re: PHP Coding Guidle lines.
« Reply #3 on: April 26, 2009, 05:26:12 PM »
There is also another guide but is a little outdated.

http://www.dagbladet.no/development/phpcodingstandard/.

Good luck

Offline Mchl

  • Staff Alumni
  • Freak!
  • *
  • Posts: 8,582
  • Gender: Male
  • That's Largo in my avatar, not me.
    • View Profile
    • FlingBits
Re: PHP Coding Guidle lines.
« Reply #4 on: April 26, 2009, 05:31:38 PM »
There is also another guide but is a little outdated.
http://www.dagbladet.no/development/phpcodingstandard/.

This one is for PHP4. Use with care.
NetBeans fanatic | ExtJS masochist | C++ denier
PHP4 & MySQL4 are no longer supported.
PHPFreaks Tutorials | PHP Debugging: A Beginner's guide | PHP Security Tutorial || How To Ask Questions The Smart Way
Flingbits tutorials | Class Autoloading

Offline coalgames

  • Irregular
  • Posts: 22
    • View Profile
Re: PHP Coding Guidle lines.
« Reply #5 on: April 26, 2009, 06:50:30 PM »
I just finished reading the Zend one and I think that the zend one is a lot better.

There is also another guide but is a little outdated.
http://www.dagbladet.no/development/phpcodingstandard/.
That one was last revised in 2003 :(

Offline Cosizzle

  • Enthusiast
  • Posts: 209
  • hi5
    • View Profile
Re: PHP Coding Guidle lines.
« Reply #6 on: April 28, 2009, 02:47:08 PM »
Ya its a total preference....

when i first started programming i would for example write my methods like this:
Code: [Select]
<?php
function myName() {
    
// code
}
?>


then a teacher came a long and got all moody so it changed to
Code: [Select]
<?php
function myName() 
{
    
// code
}
?>


now this class that im in now (new teacher) SWEARS by
Code: [Select]
<?php
function myName() {
    
// code
}
?>


so ya... stick with what you can read... just keep it clean and be flexible to change
follow me on twitter: @Cosizzle