Home  >  Article  >  Backend Development  >  Teach you step by step how to learn PHP and share your learning experience! !

Teach you step by step how to learn PHP and share your learning experience! !

卡哇伊
卡哇伊forward
2020-07-16 16:33:443061browse

Teach you step by step how to learn PHP and share your learning experience! !

I have been learning PHP for half a month. I have to type code and write notes every day. I have learned C and Java, and the process of learning PHP will be relatively smooth (^-^) The more you type and run the code, the deeper you will gradually understand the program. Let me talk about my experience in learning PHP.

Getting started with PHP is easy and the syntax is very simple, but I don’t say that PHP is easy. Difficulty is relative. PHP is indeed simpler than Java, but it doesn't take a while to learn. First understand what PHP is? What can PHP do? Why choose to learn PHP? If you want to learn PHP in the future, just try to spend a lot of time learning it deeply, and don't have the mentality of being proficient in several programming languages.

When you first learn PHP, you should set up a LAMP or WAMP environment. Although there are many integrated environments on the Internet and installation is very convenient, I still choose to build my own PHP environment. I think it is more flexible to build the environment manually, and you will have a deeper understanding of the entire environment, which will also be helpful for later learning. I was very happy when I saw It works! displayed in the browser o(≧v≦)o~~
Teach you step by step how to learn PHP and share your learning experience! !
Then I learned the basic knowledge and technology of PHP. This knowledge probably includes language basics, strings, arrays, regular expressions, interaction with web pages, encryption, object-oriented, sessions, etc. It took a few days to learn. No matter what language you learn, the basics are the most important. In terms of syntax, I feel that there are some similarities between php and javascript. As the knowledge I learned continued to increase, problems that I didn't understand began to appear, and I have always had the habit of writing notes. Mainly some of my own summaries, favorite blogs, repeated code blocks, etc.
Teach you step by step how to learn PHP and share your learning experience! !
Then come into contact with the database. PHP supports a variety of databases, especially MySQL. When you first start learning the basics of databases, it is recommended that you operate the database at the command prompt. Although there are MySQL graphical management tools, don't rely too much on it at the beginning. PHP provides mysql extension and mysqli extension for operating databases. The former has been abolished. There is also an extended PDO that is common to all databases, which shields the differences between various database systems and uses the same interface to access various databases. Just like Java's JDBC, it is very convenient to transplant programs from different databases.
Here we also need to mention some function encapsulation related to the database. When we use general methods to operate the database, we need to write many methods separately. Using object-oriented methods will enhance development efficiency. You can find some source code from the Internet to study. In addition, we must also pay attention to the optimization of MySQL, so that the database can find what we need in as little time as possible. There are also techniques for debugging programs. For example, you can segment echo results to narrow the scope of debugging. Especially when interacting with the database, first output the SQL statement to see, and then analyze why the operation failed, etc. Debugging a program may take up a lot of time. Of course, you still need to summarize your own debugging experience.

More tutorials:《php tutorial》

The above is the detailed content of Teach you step by step how to learn PHP and share your learning experience! !. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete