Tag:php

  • How PHP gets HTTP requests

    Time:2020-11-25

    Method of getting HTTP request by PHP $5 Introduction to server $5 Server is an array of information such as header, path, and script locations. Sample method for getting HTTP request $req_method = $_SERVER[‘REQUEST_METHOD’]; echo $req_method; Examples supplement: Socket mode Using socket to establish connection, splicing HTTP message to send data for HTTP request. An […]

  • Strategy of PHP design pattern

    Time:2020-11-24

    This paper describes the strategy pattern strategy of PHP design pattern. For your reference, the details are as follows: 1. Overview In software development, there are many algorithms to realize a certain functionStrategy, we can choose different algorithms or strategies according to different environment or conditions to complete the function。 For example, hard coding is […]

  • Introduction to PHP design patterns [concept, classification, principles, etc.]

    Time:2020-11-23

    This article describes the PHP design pattern. For your reference, the details are as follows: 1. Design pattern Design pattern is a set of repeated use, most people know, after classification cataloging, code design experience summary. Design patterns are used to reuse code, make it easier for others to understand, and ensure code reliability. No […]

  • PHP design pattern (1) factory mode

    Time:2020-11-22

    This paper describes the PHP design pattern (1) factory mode. For your reference, the details are as follows: In object-oriented programming, the most common method is to generate an object instance by a new operator. The new operator is used to construct the object instance. However, in some cases, the new operator directly generates objects, […]

  • PHP design pattern (3) builder mode

    Time:2020-11-21

    This paper describes the PHP design pattern: Builder mode builder. For your reference, the details are as follows: 1. Overview In the process of software development, when a “complex object” is created, the object is composed of sub objects of certain parts with a certain algorithm. Due to the change of requirements, each part of […]

  • PHP design pattern (4) prototype mode prototype example details

    Time:2020-11-20

    This article describes the PHP design pattern: prototype pattern prototype. For your reference, the details are as follows: 1. Overview As we all know, the creation pattern is generally used to create a new object, and then we use this object to complete some object operations. We can quickly create an object through the prototype […]

  • PHP design pattern (5) adapter mode

    Time:2020-11-19

    This article describes the PHP design pattern: adapter pattern adapter. For your reference, the details are as follows: 1. Overview:          Interface change is a common problem that programmers have to accept and deal with (though reluctantly). Program providers modify their code; system libraries are modified; various programming languages and related libraries develop and evolve. […]

  • PHP design mode (6) bridge connection mode

    Time:2020-11-18

    This paper describes the PHP design pattern: bridge mode. For your reference, the details are as follows: 1. Overview In software system, some types have two or more dimensional changes due to their own logic. How to deal with such “multi-dimensional changes”? How to use object-oriented technology to make the type easily change along multiple […]

  • PHP design pattern (7) composite mode

    Time:2020-11-17

    This article describes the PHP design pattern: composite pattern. For your reference, the details are as follows: 1. Overview In the data structure, the tree structure is very important, we can apply the tree structure to the design pattern. Example 1: it is a multi-level tree menu. Example 2: file and folder directory 2. Problems […]

  • PHP design pattern (8) decorator pattern illustrator

    Time:2020-11-16

    This article describes the PHP design pattern: decorator pattern decorator. For your reference, the details are as follows: 1. Overview If you’ve been in object-oriented development, you can add behavior to a class or object, and use inheritance mechanism. This is a basic feature of all object-oriented languages. If an existing class lacks some methods, […]

  • PHP design pattern (9) facade example details [structural]

    Time:2020-11-15

    This article describes the PHP design pattern: facade. For your reference, the details are as follows: 1. Overview In appearance mode, we can only see the appearance objects but not the specific details objects by wrapping the appearance. This will undoubtedly reduce the complexity of the application and improve the maintainability of the program.Example 1: […]

  • Example arrangement of PHP output form

    Time:2020-11-14

    There are several forms of output in PHP There are five output forms in PHP, which are echo and print_ r、print、var_ Dump and die. echoIt can only output single data such as string, but not data type, array and other data. print() Only single data such as string can be output, data type can not […]