Hongmu Notes
Home Language Notes

Language Notes

php jump to specified page

php jump to specified page Language Notes PHP

● PHP page jump 1. header () function header () function is a very simple method for page jump in PHP. The main function of the header () function is to output the HTTP protocol header to the browser. The definition of the header () function is as follows: VoidHeader (String String [,Boolrep …
👁 209
php mt

php mt Language Notes PHP

The mt_rand () function uses the Mersenetwister algorithm to generate random integers. Tip: This function is a better choice to generate random values, and the speed of returning results is four times that of rand () function. Tip: If you want a random integer between 10 and 100 (inclusive), please use mt_rand (10,100). & lt…
👁 172
SQL UPDATE statement updates a piece of data to the database

SQL UPDATE statement updates a piece of data to the database Language Notes mySql

UPDATE table name SET column name = new value WHERE column name = some value
👁 129
How to remove escape characters in php

How to remove escape characters in php Language Notes PHP

Php's method of removing escape characters: string stripslashes (string $str) returns a string (' Convert to ' Wait). The backslash (\) is converted into a single backslash (). Stripslashes () is non-recursive. If you want to use this function in multidimensional arrays, you need to use recursive functions.
👁 144
PHP special character escaping and restoration

PHP special character escaping and restoration Language Notes PHP PHP collection PHP and mysql

Escape character is a special character constant. Escape characters are backslashed " & quot; At the beginning, followed by one or more characters. The escaped character has a specific meaning, which is different from the original meaning of the character, so it is called "escaped" character. The use of escape characters 1: turn ordinary characters into special purposes, such as back key and enter key. 2. Used to convert a character with special meaning back to its original meaning. 3. Before data is written into the database, escape characters (function …
👁 180
Methods of division and rounding in php (round, ceil, floor)

Methods of division and rounding in php (round, ceil, floor) Language Notes PHP

When the result of division needs to be rounded in PHP, the following methods are needed: 1. round: round () function rounds floating-point numbers. Syntax: round(x, prec) parameter description x is optional. Specifies the number to round. Prec is optional. Specify the number of digits after the decimal point. Description: Returns the number of x based on the specified precision prec (decimal decimal number …
👁 212
php obtains the web page source code (accesses and returns the web page source code)

php obtains the web page source code (accesses and returns the web page source code) Language Notes PHP

Below are several commonly used methods in PHP for scraping content from web pages: 1. `file_get_contents` – PHP code: The code is as follows: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > &gt
👁 219
Typecho index.php homepage template production common codes

Typecho index.php homepage template production common codes Language Notes PHP

Creating templates is not difficult at all; once you've written your HTML and CSS code, nesting templates becomes straightforward. You don't need to understand the internal structure of the tags—simply know how to use them, and you can quickly complete your templates. This article provides a brief introduction to how to use common tags, with the aim of helping you explore the world of templating. Let's start with the main file: when you open this file, the first thing you'll see is a comment: /** * This is a set of default settings for the Typecho system...
👁 269
PHP capture website source code and json parsing

PHP capture website source code and json parsing Language Notes PHP PHP collection

Recently, I wanted to collect the names of some resource websites, so I found a fun one when I collected it. The opposite website was loaded by ajax technology, so I found the api, so I just wrote the code directly to put it in the warehouse. The code is backed up here and will be used in the future. & lt; ? php $date = file_get_contents(' Website address ' ); $date = json_deco…
👁 136
PHP regular replacement preg

PHP regular replacement preg Language Notes PHP PHP collection

& lt; ? php $str=& quot; as2223adfsf0s4df0sdfsdf& quot; ; echo preg_replace(& quot; /0/& quot; ,& quot; & quot; ,$str); //Remove the 0 character, which is equivalent to the function of replace, preg _ replace (&; quot; /…
👁 167
1 30 31 32 33