i
PHP Variables
PHP Data Types
PHP Echo & Print
PHP Strings
PHP Numbers
PHP Constants
PHP Operators
PHP if...else...elseif Statements
Switch Statement
PHP Loops
PHP Arrays
Superglobals
PHP Coding Standards
PHP Form Handling
PHP Form Validation
PHP URLs Validation
PHP Form Required Validation
Complete Form Example
PHP File Functions Open/Read
PHP File Create/Write
PHP File Upload
PHP Cookies Handling
PHP Session Handling
PHP filter_var() Function
PHP Validation Filters
PHP Sanitization Filters
Using Filters
Filters Advanced
JSON
PHP Date and Time
MySQL Database
MySQL Connect
MySQL Commands-Creating a Table
MySQL Commands-Inserting The data
MySQL Commands-Prepared Statement
MySQL Commands-Selecting The Data
MySQL Commands-Where and Order By
MySQL Commands-Deleting And Updating The Data
PHP-OOP Introduction
PHP-Classes/Objects
PHP-Constructor/Destructor
PHP-Access Modifiers
PHP-Inheritance
PHP-Inheritance and Protected Access Modifier
PHP-Overriding Inherited Methods
PHP-Final keyword
PHP-Abstract Classes
PHP-Constants
PHP-Traits
PHP-Static Methods and Properties
Introduction to Functions
Defining A function
Returning Values From A Function
Dynamic Function Calls
Variable Scope
Understanding Arguments Or Parameters
Testing For A Function Existence
Returning Multiple Values From A Function
Making practical Use By Building Code Libraries For Code Re-usability
Using Include() And Require()
Every programming language has coding standards to define best practices for the developers. Many developers would be working on the same module, and if any other developer has to understand that code, it would be very difficult for him if there is no coding standard followed. To manage the source code for the future and to make it easily understandable, PHP has some coding standards to provide clarity and simplicity.
Below mentioned are the guidelines that should be followed while writing code in PHP.
PHP standard tags should be used instead of any shorthand tags for php code delimit.
Standard commenting style, i.e. // for single-line comments and /* */ for multi-line comments used be used and avoid the use of # for commenting.
Per line code should not exceed 75-85 characters. Use four spaces instead of using tabs for indentation.
The conditional flow statements and function calls statements should be properly differentiated with a space between the keywords.
While writing a function call statement, no space should be present between the function name and opening parenthesis.
Use lower case letters for variables and _ to separate the words in a variable name. Static variables and global variables should start with ‘s’ and ‘g’ respectively.
Curly braces should be in the same alignment for a single block of code.
All the methods and functions should not be too lengthy and limit themselves to one page only.
Don't miss out!