How can I write PHP code to be hired ?, How can I write PHP code to be hired ?, KevinYank once worked as an interviewer at SitePoint. he published a GoodandBadPHPCode and elaborated on his views on the advantages and disadvantages of PHP code through some code examples. A few simple things are mentioned :? Replaced? Php, which is more in line with XML "> <LIN
Kevin Yank was an interviewer at SitePoint. he published a Good and Bad PHP Code and elaborated on his views on the merits and demerits of the PHP Code through some Code examples. There are several simple things mentioned here:
Determine whether the value of $ _ GET ['query'] is null before outputting it.
The extra parentheses in the echo command are removed.
The string is limited by single quotes, saving PHP time to search for replaceable variables from the string.
Use commas instead of periods to save the echo time.
Pass the ENT_QUOTES identifier to the htmlspecialchars function to ensure that the single quotation marks are also escaped. Although this is the most important thing, it is also a good habit.
Many PHP users are familiar with these writing rules, and these writing rules seem very idiotic. However, it took three months for them to recruit programmers who met the above conditions and satisfied them.
Not every company needs to hire programmers like this. But how to develop a good habit may be something that many programmers need to do most, including N + Masters. If you are interested, you can view mint brain's full-text translation of this article.