How to write PHP code to be hired? _php Tutorial

Source: Internet
Author: User
Tags echo command

Kevin Yank, who worked as an interviewer in SitePoint, published a good and bad PHP code, detailing his views on the merits and demerits of PHP code through some code examples. It mentions a few very simple things:

Determine whether it is empty before outputting the value of $_get[query].
The extra parentheses in the echo command are removed.
Strings are delimited by single quotation marks, which saves PHP time to search for replaceable variables from a string.
Use commas instead of periods to save echo time.
The ent_quotes identity is passed to the Htmlspecialchars function, which guarantees that the single quotation marks are also escaped. Although this is the most important, but also a good habit.
There are a lot of people who know PHP, and these rules of writing look stupid. But it took them 3 months to recruit programmers who met the above criteria to satisfy them.

Not every company recruiting programmer will ask. But how to develop a good habit, this is probably a lot of programmers need to work hard to do, including n multi-master. Interested friends can view the full-text translation of menthol on this article.

http://www.bkjia.com/PHPjc/486615.html www.bkjia.com true http://www.bkjia.com/PHPjc/486615.html techarticle Kevin Yank, who worked as an interviewer in SitePoint, published a good and bad PHP code, detailing his views on the merits and demerits of PHP code through some code examples. Several of them are mentioned ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.