Home  >  Article  >  Backend Development  >  What technologies should I learn in PHP and how to learn PHP well?

What technologies should I learn in PHP and how to learn PHP well?

WBOY
WBOYOriginal
2016-07-25 08:46:19947browse
Scholars who want to enter the world of programming, what should they learn PHP at the beginning, and how to learn PHP well? The editor will share with you php learning and explain each knowledge point of the following experience one by one.




First of all, everyone must reach a consensus that learning any programming technology requires our efforts, and we must pay attention to step by step, from shallow to deep. You need to understand each knowledge point thoroughly, and then use cases to deepen your understanding. Finally, you need to actually apply each knowledge point you have learned to the project, so that you can integrate it and finally reach the level of being able to control the project freely. Now we will Let’s take a look at how to learn PHP programming technology step by step. First, take a look at the sequence diagram for learning PHP. This learning sequence diagram is my recommended learning content and learning sequence (in addition to the content listed here, you must be on the road to becoming a master. There are definitely more technologies to learn. I am just listing the main learning content for beginners, not all):

The general questions of common nature are roughly:
1. How should I learn PHP and what is the order of learning?
2.What can you do after learning PHP?
3. I can understand the lecture, but once I write the program independently, I have no idea?
4. What kind of foundation is needed to learn PHP? Is the algorithm important?
file:///C:/Users/ASIMO/AppData/Local/Temp/TempPic/4TV24Z%7BPKCGSR%7DJQF80%7BLZ4.tmp
For PHP beginners, seeing so much content, they have already begun to retreat. However, as long as we persist in learning a part of the content every day, we will eventually master these technologies.

PHP technology is relatively simple compared to Java and .Net. The main function of PHP is to build websites, which means that PHP technology is used to develop websites. For example, 70% of the top 40 websites in the world currently use PHP technology, such as Facebook, Youbute, Sina, Baidu, Taobao, Well-known websites such as Sohu and Tencent have a large part of their business developed with PHP, so it is known as the preferred technology for web development. Software for developing PHP can be a simple notepad or some integrated development software, such as zendstudio. Here I list some common PHP development tools:
① Editplus ② Zend Studio ③ PHP Coder ④ phpedit ⑤ easyecpilse ⑥ dw ⑦ vim
I commonly use editplus and zend studio under windows. Under Linux, I recommend using vim for more professional development.

If you want to learn PHP development, you must learn it in the correct order (as shown in the PHP learning sequence diagram above). Many people are influenced by some junk books such as "Master in XX Days". PHP is a language that is more complex than JAVA. Simple, developers do not need to learn too much to develop a "such and such management system" in a process-oriented manner. Therefore, the society is filled with a large number of developers who are only process-oriented and do not understand the HTTP protocol! Don’t understand Javascript! I don’t understand how PHP works! I don't understand what real object-oriented programming design is. It's very lucky that such "no no no" developers can find 4000 jobs. What enterprises need most is people who are familiar with technologies such as "Http protocol, Javascript, PHP working mechanism, PHP program tuning, LAMP environment tuning, OOP" and other technologies, and such people are very difficult to recruit. Remember, haste makes waste, and the result of quick success will be more time wasted in the future. Think back to the road you have traveled over the years, and how many times you skipped ahead just to go faster, and ended up wasting time reworking things. According to Only in the correct order can you master PHP faster and better.
Learning PHP is divided into the following stages. Each stage has key points and precautions for learning. I will introduce it to you in detail below:

The first stage: Basics of PHP front-end web development. This stage is divided into the following stages of courses
          (1) HTML basics and enhancements
html language, HTML language background knowledge, HTML global tags, HTML format tags, HTML file tags, HTML hyperlink tags, HTML image tags, HTML frame tags, HTML client image map, HTML table tags, HTML frame tags, HTML forms Tags, HTML header elements, HTML partition tags
T (2) XHTML foundation and enhancement
The difference between XHTML and HTML, Xhtml syntax, XHTML DTD, XHTML validation, XHTML module, XHTML attributes, XHTML events, XTHML structured
(3)HTML5Design and Application
Introduction to HTML5, HTML5 multimedia processing, HTML5 canvas, HTML5 Web storage technology, HTML5 forms, HTML5 attributes and events Common tags of HTML5 (such as: applet tag, article tag, aside tag, audio tag, canvas tag, datalist tag, details tag etc.)
                  (4) CSS basics and enhancements
Introduction to CSS, basic CSS syntax, CSS derived selector, id selector, CSS class selector, CSS box model
CSS background, text, font, border, margin, padding, list, table CSS Advanced: CSS size, classification, positioning, pseudo-class, pseudo-element, media type
(5)DIV+CSS design and application
Use the home page of a well-known website to deeply analyze the web standards of DIV+CSS: classic cases of box model - Youku home page, imitation sohu home page layout, and cute house home page. Knowledge points involved include: (Four ways of CSS positioning, left floating, right floating, clear floating, standard flow and non-standard flow, setting the stacking order of objects, conversion of block elements and row elements, etc.)
                                (6)Javascript basic syntax:
Basic introduction to Javascript, development history of Javascript, analysis of Javascript operating principles, characteristics of Javascript,
Javascript identifiers, Javascript basic data types (numeric types, Boolean types, string types),
Introduction to Javascript composite data types (arrays, objects), Javascript special data types (NULL, undefine),
Definition of variables, initialization, assignment, two methods of data type conversion (automatic conversion, forced conversion), Javascript operators (arithmetic operators, relational operators, logical operators), Javascript bit operations and shift operations
              (7) Three major process controls of Javascript
Sequential control, branch control (single branch: if statement, double branch: if-else statement, multi-branch if-else if-else statement, switch-case-default statement), loop control (for statement, while statement, do- while statement), how to adjust Javascript in IE and Firefox
      (8)Javascript function
Basic concept of function, definition of function, in-depth analysis of function calling method and calling process, detailed discussion of function usage, using Function class to create functions, practical application of functions (printing pyramid, multiplication table), recursive calling of functions,
Commonly used system functions in Javascript (encodeURI, decodeURI, eval, parseInt, parseFloat, isNaN, etc.)
      (9)Javascript array
Basic use of arrays, using for/while to traverse arrays, practical use of arrays (calculating class average scores), basic use of two-dimensional arrays, using for to traverse two-dimensional arrays, transposing two-dimensional arrays, introduction to array sorting, and risks Bubble sorting, sequential search and binary query method
                                                                                                                                                                                                                                                                                                      Javascript’s Event-Driven mechanism, event source, event handler, event name, event object,
Event types (mouse events, keyboard events, HTML events, other events), Javascript access CSS technology,
Event-driven browser compatibility processing, 18 commonly used events (onblur, onchange, onfocus, onkeydown, onmousedown, etc.) Comprehensive case (Javascript version calculator)
                                              (11) DOM Programming
Introduction to DOM programming (HTML DOM and XML DOM), introduction to DOM programming examples, introduction to BOM, introduction to DOM objects, detailed explanation of window object, detailed explanation of history object, detailed explanation of location object, detailed explanation of navigator object, detailed explanation of screen object, detailed explanation of event object, and document object Detailed explanation, detailed explanation of body object, detailed explanation of style object, WEB version of Tank Battle Game, forms object (collection), from object, images object (collection), img object, links object (collection), link object, all object (collection), table Detailed explanation of objects, tableRow objects and tableCell objects, user management system based on table objects
(12)WEB website design and application->Commercial-grade web page production


I once said something like this: Some friends who study technology are like a fat man with a big belly and a big head. He looks very bluffing, but his legs are so thin that he will fall down when the wind blows. That is to say, the foundation is too poor, and the result is that the more you learn, the more confused you become, and finally, you give up. That’s why I say “the foundation is very important”. There is another point I want to emphasize: in the video tutorial, I talked about a lot of cases and laid out the functions. You must write the code skillfully by yourself. Remember to write it by yourself, and You don't just copy my code, let alone think you have it after you understand my code. You have to know that there is a huge difference between "understanding" and "being able to write"! We learn programming It is "learning by doing", which is learned in the process of doing, rather than doing it after learning. It is in the process of writing line by line of code that one gradually establishes programming ideas. The process of thinking → code requires typing a lot of code.
file:///C:/Users/ASIMO/AppData/Local/Temp/TempPic/G7GRXYP~EQ94)MR4~E20Y3I.tmp
                                                                                                                                                                                                                               say, “I don’t have one, but I’m familiar with it.” Please always remember that “skill comes from proficiency.” This is what we often say, “Practice makes perfect.”
Phase 2 PHP core programming
(1) PHP basic syntax enhancement
Apache-- directory configuration section, two ways to bind one IP and multiple domain names, introduction to HTTP protocol, introduction to Apache logical components, Apache life cycle, PHP running sequence diagram, PHP data type enhancement, PHP various Enhanced operators, PHP three major process control enhancements, bit operations (bitwise AND, bitwise OR, bitwise XOR, bitwise NOT, bit left shift, bit right shift), binary (original code, complement, complement code), PHP version of online loan calculator.
Here, I would like to explain: The basic syntax of PHP seems simple, but you should not be careless. Some PHP programmers have worked for 2 years and do not know the principles of PHP operation. They do not understand some important tuning configurations of Apache. Such programmers cannot work in the company, and it is difficult to get promoted. So I have always been a coding worker, and my salary has not increased.
For example, we are often asked in interviews: What is the range of an integer in PHP, and what is the range that decimals can represent? Another example is how to configure a 404 error page in Apache, how to configure a domain name for a host, and how to do it specifically? Such basic issues must be resolved at this stage. It is recommended that everyone watch the Chuanzhi Podcast PHP video tutorial 23-45, which has detailed explanations.
(2)PHP function
Basic introduction to PHP functions, how to customize functions, calling functions on PHP pages, the differences between require(), require_once(), include() and include_once(), analyzing the PHP function calling process from memory, details that need to be paid attention to when using functions, The difference between function value passing and reference passing.
Function is the most important knowledge point in our PHP programming, and it is also the basis for modular programming. Mastering functions well can improve the reusability, readability and maintainability of the code.
      (3) Array, sorting and search
Basic concepts of arrays, reference methods of arrays, array reference traps, three ways of traversing arrays with PHP array-related functions (count, is_array, print_r, explode, etc.), deleting array elements and array operators, summary of array usage details , Introduction to internal sorting and external sorting, bubble sort and quick sort, selection sort and insertion sort, sequential search and binary search, introduction and use of two-dimensional arrays.
According to my experience, when we look for a job, we will definitely get a question about sorting and querying. The most common question is: Please write down the bubble sort method and use binary search to find a number. In project development, arrays are an important data type that connects variables and functions. In MVC development, arrays often need to be assigned to views in the controller for display. In algorithms, arrays are also the most flexible.
        (4) Object-oriented programming
Basic concepts of object-oriented programming, the relationship between classes and objects, how to define classes, member attributes (variables), how to create object instances and how to access object attributes, the form in which objects exist in memory, stack, heap, global area, constant area Relationship with the code area, member methods (functions) and usage details, constructor methods (functions), default constructor methods (functions), the basic concept and use of this, destructor methods (functions), PHP's object garbage collector, static The concept and use of variables (class variables), the concept and use of static methods (class methods), introduction to the three major characteristics of object-oriented programming, object-oriented programming - encapsulation, object-oriented programming - inheritance, object-oriented programming - polymorphism, access Control modifiers (public, protected, private), method overload (overload), method override (override), comparison of method overload (overload) and method override (override), PHP magic function (__set __get __construct __destruct __call etc.) and magic constants (__LINE__, __FILE__, __FUNCTION__, etc.), the concept of abstract class and the concept and use of interface, the difference between interface programming and inheritance, the use of the keyword final, the constant keyword The role and usage precautions of const, the powerful reflection mechanism of object-oriented programming, and the dynamic proxy of object-oriented programming.
Object-oriented programming has become the mainstream of PHP programming. Object-oriented programming makes programs more powerful and flexible, and is more conducive to project development and maintenance. About object-oriented programming in Chuanzhi Podcast PHP Video Tutorial Lectures 61-78, let’s see what is the real PHP object-oriented thinking and what is the real OOP.
     (5) Error handling and exception handling
Basic concepts of error handling, introduction to three ways of handling errors in PHP, using die() process error handling, custom errors and error triggers, error logs, introduction to error levels, basic introduction to PHP exception handling, PHP exception handling ( try throw catch), custom exceptions, how to set up top-level exception handlers, rules for exception usage.
Error handling is an important part when writing php web applications. If your code lacks error checking, the program will look unprofessional and open the door to security risks. Therefore, everyone needs to know how to effectively handle errors and exceptions in PHP programming to ensure the safety and robustness of the program.
     (6) Predefined super global array
Predefined super global array - basic concepts, $_GET, $_POST, $_REQUEST, $_SERVER, $_ENV, $_FILES, $_COOKIE, $_SESSION, $GLOBALS, $_GET usage traps (sql injection and Chinese garbled problems)
(7)Cookie and session
What is a session, the basic concept of cookies, the curd operation of cookies, the important API introduction of cookies, the illustration of cookie operation principle, the practical application of cookies (displaying the last visit time of the user, displaying the products the user last browsed), cookies Precautions for use, location and form of session data storage, session curd operation, session operation principle illustration, session actual case - online shopping cart, session processing plan after IE disables cookies, session prevents user illegal intrusion, session cooperation verification code Use, php.ini instructions on cookie and session configuration (key points, difficulties), custom session processor, the difference between Session and Cookie.
Cookie (cookie) is a client-side technology. The server writes each user's data to the user's respective browser in the form of a cookie. When users use a browser to access web resources on the server, they will bring their own data with them.
Session is a server-side technology. Using this technology, the server can create an exclusive session file for each user's browser when it is running. When the user accesses other web resources in the server, he or she can access the session file from the user's respective browser. Data is retrieved from the session to serve users. Session and Cookie are the most important user behavior tracking technologies, especially in e-commerce and SNS projects. Therefore, they are the focus and difficulty of our study, and they are also the focus of the interview and written test. Regarding cookies and sessions, you can refer to Chuanzhi Podcast PHP video tutorial 114-121
(8)PHP file programming
What are files and file programming, the basic concepts of file streams, how to operate files, a summary of PHP file programming functions, the 13 most commonly used file functions, using files to complete website counters, file upload and download operations-mini music sharing network , unlimited file scanner.
The main function of a file is to save data. It can save a picture, video, sound... This chapter requires students to master the various operations of files, upload and download, and dynamically create and delete directories and files. and unlimited scanning of files, etc. Mastering these knowledge points is very important for our project development.
        (9) PHP drawing technology
php drawing coordinate system, drawing step instructions, quick start of drawing, the most commonly used functions for drawing, practical application of drawing technology - population distribution pie chart, professional report development - JpGraph, installation and configuration of JpGraph, practical application of JpGraph -Netizen support statistics chart, JpGraph Chinese garbled processing.
If you have used financial software, you must have seen various charts for statistics and analysis of financial data, which may be tables, pie charts, bar charts, curve charts... To put it simply, use Charts dynamically display data. The display of these charts requires the use of PHP drawing technology, which requires proficiency in using PHP's drawing functions to complete the project's needs. Being able to develop some statistical charts is of great practical value. For example:
[img]file:///C:/Users/ASIMO/AppData/Local/Temp/TempPic/@$EU9Q4XE[OQZY99JQF$N(D.tmp[/img]

How to test your learning effect? ​​Take a look at some of the interview questions below to see how much you can complete? If you can complete 80% correctly, it means you have learned well at this stage.
Exercise 1: Briefly describe the differences between echo(), print(), and print_r()?
Exercise 2: Name PHP’s super global variable array, nine types in total
                                                                                                                                                                                                                                         Exercise 3: How to use variables with global properties in a php function, tell me two ways
Exercise 4: Three questions:
4.1. Diving competition, scored by 8 judges. The athlete's score is the highest score removed from the 8 scores, the lowest score removed, and the average of the remaining 6 scores is the final score. Use a one-dimensional array to implement the scoring function.
4.2. Please find out the judge who gave the highest score and the judge who gave the lowest score.
4.3. Find out the best and worst judges. The best judge is the judge whose score is closest to the final score. The worst judge is the one with the biggest difference between the score and the final score.
Exercise 5: Both include and require can include another file into the current file. What is the difference between them? What is the difference between Include and include_once?
Exercise 6: Write a PHP function that can create multi-level directories
Exercise 7: Write a function that can recursively list all folders and file names in a directory.
Exercise 8: When preventing SQL injection, single quotes, double quotes, etc. will usually be escaped. Which function needs to be used
Exercise 9: Write the code for insertion sort and quick sort
Exercise 10: What is the principle of binary search? Please write the binary search function
Exercise 11: Write out the differences between PHP’s three access control modes: public, protected, and private
Exercise 12: Please write a complete and rigorous singleton pattern
Exercise 13: What do the __set and __get magic functions do and when are they triggered
Exercise 14: How to prevent object cloning. Will object cloning copy static properties?
Exercise 15: Tell us about the function and usage of strip_tags?
                                                                                                                                                                                                                                          Exercise 16: If the content input by the user needs to be output as is, which function should be used to process the data before entering it into the database?
Exercise 17: How to control multiple processes to concurrently delete, insert and update a table in the database?
Exercise 18: The difference between PHP safe mode and non-safe mode
Technology is just a layer of window paper. If you pierce it, you will feel nothing. Isn’t it that simple? But if you don’t know, it feels very mysterious, so the more knowledge points you understand and the lower level, the more technical content you can make your project.
On the other hand, if we know a lot of knowledge points, but cannot flexibly apply the knowledge points to the project, we will become Duan Yu in "Dian Long Ba Bu", with infinite internal strength, that is Don't know how to use it. Therefore, learning to do projects and doing standardized projects is also a very important third stage: MySQLDatabase Programming & Intermediate Project Stage

(1) mysql database
From the current point of view, any project or website with commercial value is inseparable from the MySQL database. Therefore, it is very important to have a systematic and in-depth grasp of the various operations of the MySQL database. The focus is on learning around ddl/dql/dml/dcl/dtl. At the same time, you must learn how to design a database model with commercial value in the project, and initially understand the optimization details of MySQL. As a qualified PHP programmer, I think the following knowledge points must be mastered:

Three-tier structure of MySQL database, installation and configuration of MySQL database, common operations of database command line (start, connect, operate, close, etc.), SQL statement classification (ddl/dml/dcl /dql/dtl), creation, viewing , delete, modify, backup and restore the database, how to create tables and detailed explanations of MySQL data types, modify and delete table operations, how to perform CRUD operations on data tables, use orderby in select statements, and total functions (count/sum/avg/max/ min), use of group by and having clauses in select statements, 10 commonly used functions for time and date, 11 functions related to strings, 10 mathematical functions, 3 process control functions, 4 other functions, MySQL Chinese garbled processing, PHP operates database instances, MySQL table types and storage engines (BDB/HEAP/ISAM/MERGE/MYISAM/InnoBDB), how to choose the storage engine for tables, basic concepts of transactions, transactions and locks, transaction commit and rollback operations, PHP programs How to use transactions, transaction isolation levels, primary keys and foreign keys of tables, multi-table union queries and Cartesian sets, self-joins, single-row subqueries and multi-row subqueries, worm replication to create massive tables, merge queries (union, union all , intersect, minus), inner joins and outer joins of tables (left outer join, right outer join and complete outer join), maintaining data integrity - constraints (not null, unique, primary key, foreign key, and check), Store vending system table design cases, indexes (primary key index/unique index/full-text index/common index/composite index), analysis of index advantages and disadvantages, triggers and stored procedures

(2) Database programming (mysql mysqli pdo)
Introduction to mysql extension library, mysql extension library operation mysql database program, mysql_query() execution results, releasing resources and connections, CRUD on mysql database, introduction to mysqli extension library, the first mysqli extension library program, $mysqli->query ()Execution results, mysqli CRUD operation on the database, mysqli extension library enhancement--batch execution of sql statements, mysqli extension library enhancement--transaction control, transaction acid, preprocessing MySQLi_STMT, introduction and use of PDO

(3) Intermediate Project
After reading it ten times, it’s better to actually do a project yourself. Project experience is accumulated from lines of code, and programming abilities are also improved by overcoming program bugs. The intermediate stage project is the best time to actually apply the knowledge points learned previously to the project, and it is also the time to test your learning results. When you finally complete the project by staying up late, lighting up the lights, and searching for information online, and experiencing the project from scratch, from existence to perfection, your programming ability and ability to control the project have improved subtly, setting the stage for the next stage of learning. (PHP Advanced Programming) to lay a solid foundation. I recommend several projects to everyone. You can choose a project to do according to your actual situation.
BBS system: Provides interaction and communication functions for Internet users.

The above are the content and knowledge points for learning PHP. More related information: http://www.kokojia.com/list/219.html



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