Home  >  Article  >  Backend Development  >  What to learn before learning PHP

What to learn before learning PHP

silencement
silencementOriginal
2019-09-26 15:25:132516browse

What to learn before learning PHP

Go straight to the topic, no nonsense:

1. Familiar with basic elements of web pages such as HTML/CSS/JS. At the completion stage, you can create simple web pages by yourself and understand the element attributes. Relatively familiar.

2. Understand the concepts and operating mechanisms of dynamic languages, and be familiar with basic PHP syntax.

3. Learn how to combine PHP with HTML to complete a simple dynamic page.

4. Get in touch with MySQL and start designing databases.

5. Continuously consolidate PHP syntax, be familiar with most of the common PHP functions, understand object-oriented programming, MySQL optimization, and some templates and frameworks.

6. Finally complete a fully functional dynamic site.

Thoughts before learning PHP

Novices should not think that learning PHP is very simple after seeing the above summary. Programming requires serious thinking and continuous practice. The following is a detailed explanation of the PHP learning route. First of all, any website is composed of web pages, which means that if you want to complete a website, you must first learn to make web pages. Mastering the technology of making static web pages is a prerequisite for learning to develop websites. Therefore, we need to learn HTML to lay the foundation for making websites in the future. Learning HTML should be done while learning. Every element in HTML must be practiced personally. Only after you understand what elements will have what effect can you remember them deeply. Just reading books will not work.

Understand HTML before learning PHP

Assuming that you can already complete a static page, then it is time to start understanding dynamic languages. When you first come into contact with dynamic languages, many people may have a lot of confusion. , the code is not output directly, but needs to be processed. HTML passes through the HTML parser, and PHP also passes through the PHP parser. It is the same as learning HTML. If you want any parser to work, you must use it. Special grammatical structures.

You should feel lucky to learn PHP, because if you have learned other languages, you will find that PHP is relatively simple. At this stage, you have to understand the concepts of HTML and PHP, and you can do it now Let PHP calculate for you how much one plus one equals, and then output it in the browser. Don't feel naive. Although this is a small piece of code, it is a big step forward in your programming journey. But now, you are still a rookie.

You need to understand MySQL before learning PHP

The next step is to learn the database. MySQL can be said to be the golden partner of PHP. We must conquer this database. After you understand the concept of the database , you must try to connect to the database through PHP, and then use PHP to successfully insert, delete and update data.

At this time, you may be in this state: Do you know HTML? Yes, I can compile several web pages with table layouts! Do you know PHP? Yes, I will write the operation of one plus one in the function and then call it! Do you know MySQL? Yes, I can insert and delete data in the database!

So what should we do next? Try making a small guestbook. This is also a hurdle faced by novices. After a while, you finally learned to insert the form data into the database and then displayed it. It should be said that the prototype of a program has been born. However, you may look at someone's editing forum or developing CMS. When can I write one? Don't worry, consolidate your knowledge and become familiar with the essentials of PHP and MySQL development. Then look back at the guestbook you wrote. You may wonder if it was really written by you? At this time, you can improve the guestbook you wrote. The guest book should have registration and paging functions, and if possible, the UI can also be enhanced.

You will choose the PHP framework when developing

Does this count as learning? NO, NO, NO, it's still early. You haven't touched OOP yet, right? What about templates and frameworks? Still have to continue learning! The PHP framework provides a basic framework for building web applications, thereby simplifying the process of writing web applications in PHP. It can save development time and help build more stable applications. So, PHP framework is a tool that can be used to save time and enhance your code. When you first choose a PHP framework, it is recommended to try several. Each framework has its own strengths and weaknesses. For example, the Zend framework has been popular for a long time due to its diverse functions and a wide support system. CakePHP is a PHP framework later than Zend, and the corresponding support system is relatively small, but it is more convenient and easier to use.

After understanding object-oriented and frameworks, you should get in touch with XML. In short, you will never find that you have learned everything, and there is no end to learning! When learning something, never expect a quick fix. No matter how many skills you have, it will be in vain if you lack hard work. One thing that can be guaranteed is that if you have learned PHP, then you will definitely learn other languages ​​quickly. Vice versa, if you have learned other languages ​​before, then you will definitely learn PHP quickly.

Read more and learn more

It is definitely beneficial to learn more from other people's successful codes, so looking at those classic codes that have been refined over time is the best way to make progress. In addition, it should be emphasized that you may encounter difficulties and get confused when learning a technology. You may have learned half of PHP and start thinking about C# again, or someone may say that Java is very good. At this time, you must not Wave, persist, and learn thoroughly. PHP is the best development language in the world. You can definitely develop the website you want.

The above is the detailed content of What to learn before learning PHP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn