Instance One
The code is as follows
Copy Code
$string = "I am ABC";if (Ereg ("Www.111cn.net", $string)) echo "' abc ' is true ";if (Ereg ("^abc", $string)) echo "' ^abc ' is true ";if (Ereg ("abc$", $string)) echo "' abc$
fopen Read File instances
The code is as follows
Copy Code
$path = ' a.txt ';$FP =fopen ($file, "R");//Open file as read-onlywhile (!) ( Feof ($FP))){$text =fgets ($FP);//read a file on one lineEcho $text;}
php File Upload Simple example application
The code is as follows
Copy Code
The Enctype property of the Upload this file:
3.php file
The code is as follows
Copy Code
Move the file
The code is as follows
Copy Code
function Upfile ($filename, $type, $path){ $tempfile =$_files[$filename];//receive uploaded temporary files There was no upload successif ($error = $tempfile ["Error"]){Switch ($error) {Case 1:
PHP Tutorial Regular judgment Chinese character
$STR = "China";Echo $str;echo "";
if (Preg_match ("/^[". Chr (0XA1). " -". Chr (0xFF)."] +$/", $str)) {//can only be used in gb2312 casesif (Preg_match ("/^[x7f-xff]+$/", $str)) {//compatible gb23
[Ajax Introduction]
Ajax is a Web application development method that uses client script to exchange data with a Web server. Web pages can be updated dynamically without interrupting the interactive process. With Ajax, users can create a direct,
Theme after a long timeThe result shows that there is a problem with the local build.Why don't we bother? (? ^ ?)?When posting in Baidu POST BarJSON is often used to obtain some values.So how does PHP output JSON data?In fact, the 'json _ encoding'
Compressing css code reduces the file size, reduces the amount of network transmission and bandwidth usage, and reduces the processing pressure on the server.Source code: The code is as follows:Copy code $ String = trim (stripslashes ($ _ POST ['
For example, when an atomic bomb is dropped, blood may be reduced for troops or buildings in the killing range. However, the damage degree varies with the distance from the central point, in addition, different types of weapons and damaged buildings
I have a good explanation on segmentfault:If you use closed tags, any developer, user, or the spaces after inserting the closed tag in the FTP application may cause redundant output, PHP errors, and subsequent output failures or blank pages.
The filter function filters IP addresses by using the following methods: The code is as follows:Copy code Echo filter_var ("127.0.0.1", "FILTER_VALIDATE_INT"); // return true or false Example.Determine whether the IP address is valid The code
Export classPHPExcel-type excel export, while some simplified PHPExcel processing, basically can meet the data export excel functionThe code is as follows: The code is as follows:Copy code // Load the PHPExcel classRequire './phpexcel/PHPExcel.
Php code The code is as follows:Copy code // Use the instanceInclude 'mobile _ Detect. Php ';$ Detect = new Mobile_Detect ();// Check for any mobile device.If ($ detect-> isMobile ())// Check for any tablet.If ($ detect-> isTablet ())// Check
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