Using PHP in three simple ways to achieve the mobile phone number of the middle four (n-bit) with an asterisk display:
$mobile = ' 13912345678 ';1. String interception method$newMobile 1 = substr ($mobile, 0, 5). ' '. substr ($mobile, 9);echo
Example. Const constant Access
The code is as follows
Copy Code
Class Math {Const num=3.14;Public Function Shownum () {return self::num;}}echo Math::num. " ";$math =new Math ();echo $math->shownum ();Results:3.143.14
For statementYou can use a For statement if you have determined how many times the code block has been repeatedly executed.
Grammar
Php
The code is as follows
Copy Code
for (initialization; condition; increment){code
So how do you let computers know that their allies are being attacked? and respond automatically?
The problem to be solved: Once a computer is attacked by us, other computers will be informed and automatically send troops to help.
Train of thought:
Example 1
The code is as follows
Copy Code
/** Function: PHP a variety of ways to achieve the perfect download remote pictures saved to local* Parameters: File URL, save file name, use the download method* Use the
An example is provided:In the Windows environment: Originally in the php4.3.0 of the program, in the 4.3.1 Why many errors, the general hint is: notice:undefined varialbe: variable name.
For example, code that resembles the following:
The code is as follows
Copy Code
Include_once ("class/rss.class.php");//Introduction of RSS PHP class$RSS = new RSS ("Name", "Address", "description", "RSS channel icon");$RSS->additem ("title of the Log", "Address of the log",
pages.at established stable 25M free PHP spaceSupport FTP upload and management files;
Support PHP4, but do not provide MySQL database, this site has been introduced several dedicated to provide a free MySQL database, such as Freemysql;
Free 1
/*Array getimagesize (string $filename [, Array & $imageinfo])
The getimagesize () function determines any given image size of the file and returns the size of the text string with the file type and height/width used in a normal HTML img tag and
Also used yesterday to a PHP online questionnaire survey program Oh, customers want to advertise in Sina, so to count the user related information, okay, let's look at the effect page first
Questionnaire Survey 1, Luzhou old cellar tequ How many
A blank line, which may include, line breaks,  , and spaces. When processing a string, it is unavoidable to encounter a blank line processing.1, replace blank lines, blank lines can include spaces, ,\t,\f,\n
$s = preg_replace ('/(^ (\s|) *$)/M '
I. Function prototypeArray glob (string pattern [, int flags])Note: The glob () function returns an array containing matching files/directories. If an error occurs, FALSE is returned.2. Version compatibilityPHP 4> = 4.3.0, PHP 5III. Basic functions
$ _ Files ["file"] ["name"]-name of the uploaded file$ _ Files ["file"] ["type"]-type of the file to be uploaded$ _ Files ["file"] ["size"]-size of the uploaded file, in bytes$ _ Files ["file"] ["tmp_name"]-name of the temporary copy of the file
During a routine check log, we found that a large number of PHP connection Memcached timeout errors were found in the Nginx log, as shown below:PHP Warning: Memcache: connect (): Can't connect to 127.0.0.1: 11211, Connection timed out (110)
In Windows IIS 6.0, PHP is usually configured in CGI, ISAPI, and FastCGI. These three modes can be successfully run in IIS 6.0, the following describes the differences in configuration and performance of the three methods.1. CGI(Common Gateway
Replace hb. ttf with the ttf you just downloaded.Header ("Content-type: image/PNG ");$ Str = "first, when there is a conflict with everyone, the main person will use work hours for them to make Chinese products. When I arrive, he will make
The program running result below is () The code is as follows:Copy code ? $ Numb = array (Array (10, 15, 30), array (10, 15, 30), array (10, 15, 30)); Echo count ($ numb, 1 );A.3B .12C.6D.9 Answer: BIf the mode in the count function is set to
This is because of PHP. Some settings in INI are incorrect. The most likely reason is that there are invalid DLL files. But why?I created an empty test. Php file under WIN32.Then execute c: php4php.exe test. php. At this time, my php. ini
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service