PHP statistics User Agent data of Nginx log

For reprint, please indicate the source of the article: https://tlanyan.me/stat-user-... The crawler is about to be used, so I plan to collect User Agent(UA) data. Then immediately think of their website access log is not ready-made high-quality data source? So I decided to write a script to count the UA information in the Nginx access log. Th ...

Posted on Sun, 01 Dec 2019 01:36:10 -0500 by bhoward3

How to use mongodb+php

Mognodb database connection default format $m = new Mongo(); //In this case, the default port 27017 of the local computer is used. Of course, the remote host such as 192.168.0.4:27017 can also be connected. If the port is 27017, the port can be omitted. Standard connection $m = new Mongo("mongodb://${username}:${password}@localhost"); Example: ...

Posted on Sat, 30 Nov 2019 21:46:28 -0500 by ttroutmpr

Applet development: getting user information

Introducer Recently in the development of small programs, recorded some.In the past, wx.getUserInfo could be used to obtain user information, but later it was officially carried out adjustment , so we need to change our thinking. Get user nickname and Avatar This step is very convenient. You can use the built-in components of the applet to get ...

Posted on Sat, 30 Nov 2019 21:28:40 -0500 by levi_501_dehaan

Basic usage of CURL function extension in PHP

PHP's curl function provides many functions, which need to be combined according to specific steps. Let's first understand the basic steps for PHP to establish a curl request. $ch = CURL init(); / / create a new CURL resource to assign to variable $Ch curl_setopt($ch, CURLOPT_URL, $url); / / set URL $response = curl_exec($ch); / / execute, ge ...

Posted on Sat, 30 Nov 2019 18:00:57 -0500 by hours12

Redis usage record

List (list) List is a simple String list, sorted by insertion order. You can add an element to the head or tail of the list. A list can contain up to 232 - 1 elements (more than 4 billion). Application scenario Information list For example, the information flow of microblog can be displayed in chronological order. Task queue You can add tasks t ...

Posted on Sat, 30 Nov 2019 12:55:01 -0500 by jeopardy_68

New features of Mix PHP V2: CO program and timer

Association Mix PHP V2 Based on the development of PHP Stream Hook co process technology of Swoole 4, the usage of CO process is almost the same as that of Golang, including the co process pool, connection pool and command line processing encapsulated by the framework, which refer to the system library style of Golang. In addition to the lack o ...

Posted on Fri, 29 Nov 2019 15:00:54 -0500 by Fergal Andrews

Native Ajax walkthrough

Native Ajax send request: 1. Create XMLhttpRequest object In ie, it is the early IE browser of ActiveXobject("Microsoft.XMLHTTP") 2. Prepare to send 3. Execute sending action 4. Specify callback function Case: 1.html file <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> & ...

Posted on Fri, 29 Nov 2019 11:33:15 -0500 by Supernovas

jQuery - block all Ajax requests (unified processing timeout, return result, error status code)

Sample code:    <html> <head> <title>hangge.com</title> <meta charset="utf-8"/> <script type="text/javascript" src="./jquery-1.11.1.min.js"></script> <script> //Global ajax access, session timeout when processing ajax clearing $.ajaxSetup({ contentType:"ap ...

Posted on Fri, 29 Nov 2019 10:37:27 -0500 by pauldr

The complete code of checking whether the mobile device is in php

When making a web page, you need to get whether the current device to open the web page is the browser of PC or the browser of mobile device, and then make the page display appropriate content for different devices; For this demand scenario, I think there are three ways to achieve it: Method 1: through css; Method 2, through js; Method 3: t ...

Posted on Fri, 29 Nov 2019 09:23:59 -0500 by rline101

How to access the common mainstream 100 express logistics query api interfaces

Express Logistics query API interface Express query interface refers to the open application program interface of Express query network. Developers can interact with Express query network by calling the interface, and develop their own Express query application program based on the interface. Application scenario ① buyer's logistics query: ...

Posted on Thu, 28 Nov 2019 15:46:38 -0500 by Phate