1. Indents and Spaces
When writing code, you must be aware of the code's indentation rules:
Use 4 spaces as indents without using the tab indent
When a variable is assigned, a space is left around the equals sign.
For a greater degree of effort reduction, it is recommended that you use large IDE management code to maintain code aesthetics.
2. Sentence break
Code writing should follow these guidelines:
Try to ensure that the program statement line is a sentence.
Try not to make one line of code too long, usually within 80 characters.
If the line of code is too long, use the ". =" method to write the lines.
When performing SQL statement operations on a database, try not to write SQL statements inside a function, but first define the SQL statement with a variable and then invoke the defined variable in the function that performs the operation.
3. Better habits
Use variables that already exist in PHP, rather than defining them yourself.
Using commas as connectors in echo is more aesthetically pleasing and more efficient than using dot numbers
More detailed comments
Do not abuse grammatical sugars.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Code style of coding specification (IV)