Tag:php

  • PHP regular expressions commonly used in the introduction and application example code

    Time:2021-5-9

    More comprehensive examples can be referred toCollection and collation of the most commonly used PHP regular expressionshttps://www.jb51.net/article/14049.htm PHP regular expression summaryhttps://www.jb51.net/article/19831.htm Several skills of using PHP regular expressionhttps://www.jb51.net/article/19832.htm The following content is commonly used in PHP regular, regular is a general syntax, you can download more comprehensive regular online, to provide learning!Functions: segmentation, matching, search, […]

  • Detailed explanation of signal processing operation examples in PHP

    Time:2021-5-8

    This paper introduces the signal processing operation in PHP. The details are as follows: First we need to know a few functions pcntl_ signal    Install the signal processor, that is, when the specified signal occurs, call the function.pcntl_ alarm    Send sigalrm signal to the process after the specified number of seconds.posix_ Getpid returns […]

  • Example analysis of blocking and non blocking operation in PHP multiprocess

    Time:2021-5-7

    This paper introduces the blocking and non blocking operations in PHP multiprocess. The details are as follows: We use pcntl_ Fork to create a child process, using pcntl_ Wait and pcntl_ Waitpid receives the subprocess back and forth. After the child process exits, if the parent process does not recycle in time, a zombie process […]

  • Example analysis of static variables in PHP function

    Time:2021-5-6

    This paper describes the use of static variables in PHP functions with examples. The details are as follows: <?php function msg() { static $a = 0; echo $a++, ‘<br />’; } msg(); msg(); msg(); The above code outputs 0, 1 and 2 static variables $a respectively. After the first definition and initialization, it will stay […]

  • Analysis of JSP instance of Ajax cross domain solution in PHP

    Time:2021-5-4

    In this paper, an example of Ajax cross domain solution in PHP, jsonp, is introduced. The details are as follows: First of all, what’s the difference between JSON and jsonp? JSON is a text-based way of data exchange, or a format to describe data. var person = { “name”: “test”, “age”: “25”, “Sex”: “male” }; […]

  • Document. Domain + iframe case analysis of PHP Ajax cross subdomain solution

    Time:2021-5-3

    This article describes the solution of PHP Ajax cross subdomain: document. Domain + iframe. The details are as follows: For the same primary domain and different subdomains, we can set the same document. Domain to cheat the browser to achieve the effect of cross subdomain. For example, we have two domain names: www.a.com And img.a.com […]

  • Windows.name example analysis of Ajax cross domain solution under PHP

    Time:2021-5-2

    In this paper, we give an example of window. Name, which is a cross domain solution of Ajax in PHP. The details are as follows: Principle core: the name attribute of the window object is a very special attribute. When the location of the window changes and then reloads, its name attribute can remain unchanged. […]

  • PHP reflection dynamic access class method, attribute, parameter operation example

    Time:2021-5-1

    This article describes the PHP reflection dynamic access class method, attribute, parameter operation. The details are as follows: We can dynamically obtain the detailed information of class methods, properties, parameters and so on through PHP reflection when PHP is running. Purpose: Design of plug-in, automatic generation of documents, expansion of PHP language. <?php class Person […]

  • How to pass PHP function parameters

    Time:2021-4-30

    When a function is called, parameters need to be passed to the function. The parameters passed into the function are called actual parameters, while the parameters defined by the function are called formal parameters. There are four ways to pass parameters to functions: value passing, reference passing, default parameter and variable length parameter. 1. Value […]

  • The meanings of / ISU, / is, / s followed by PHP regular expressions

    Time:2021-4-28

    I match case The dot metacharacter (.) in pattern s matches all characters, including the newline character Except for the escaped or in character class, the white space characters in X mode are completely ignored, and all the characters, including both ends, between # and the next newline character, except for the escaped or in […]

  • PHP implementation of wechat app online payment function (code example)

    Time:2021-4-27

    Applet access address: payfee.php   If the TP framework is used to deal with the background, it can be written as a method include ‘WeixinPay.php’; $appid=”; // App ID $openid= $_POST[‘id’]; $mch_ id=”; // Wechat payment merchant payment number $key=”; // API key $out_trade_no = $mch_id. time(); $total_fee = $_POST[‘fee’]; if (empty($total_ Fee // deposit […]

  • PHP terminate script execution instance code

    Time:2021-4-25

    To terminate the script execution means to tell the PHP engine through a statement that other statements after this statement do not need to be executed. PHP provides three ways to terminate script execution: return, die and exit Return: the execution exits at this point. If it is in a function, it means to exit […]