For example, my http://www.111cn.net/xx. php file I don't want anyone to access directly from a browserBut if you connect to http://www.111cn.net/xx. php from any website, you can accessThe connection established on the local machine cannot be
Introduction to bubble sorting:Bubble Sort is a simple sorting algorithm in the computer science field.It repeatedly visits the series to be sorted, compares two elements at a time, and exchanges them if their order is wrong.The work of visiting a
To download a simple object, you only need to use the HTML connection tag and specify the URL value of the href attribute as the downloaded object. The code is as follows: The code is as follows:Copy code download file If you download the
There are three methods for passing parameters in CLI (Command Line Interface.1. getopt function (PHP 4> = 4.3.0, PHP 5)Create a File: The test1.php code is as follows:$ Opt = getopt ('M: n :');Print_r ($ opt );?>Then run the commandPhp
Solution: Use the template replacement technology (no time delay) The code is as follows:Copy code /*| ------------------| | ------------------*/$ Users = $ _ POST ['users']; // add operationIf ($ region = 'ADD '){$ Title = $ _ POST ['title'];$
The code is as follows:Copy code Read the last few rows of data from a large file:/*** Get the last $ n lines of the file* @ Param string $ filename File path* @ Param int $ n the last few rows* @ Return mixed false indicates an error occurred.
1. Do not copy variables at will.Sometimes, in order to make PHP code more clean, some new PHP users (including those who follow the rules themselves) will copy the predefined variables to a variable with a shorter name, in fact, the result is a
Example The code is as follows:Copy code Function is_exist ($ str, $ key ){Foreach ($ key as $ v ){If (strpos ($ str, $ v)>-1 ){Return true; } }Return false;}$ Str = 'abcdefg US China ';$ Key = array ('4', '5', 'A ');If (is_exist ($ str, $ key )
The code is as follows:Copy code $ Tempaddtext = "php splits UTF8 font strings into single words and returns an array "; $ Cind = 0;$ Arr_cont = array ();For ($ I = 0; $ I If (strlen (substr ($ tempaddtext, $ cind, 1)> 0 ){If (ord (substr ($
There are two main methods to pagination the article content:Method 1. Paging by word countPaging by words is easy to use, but the effect is poor.General Idea: first, set the maximum number of words per page. Then, calculate the total number of
Check whether a user has entered a valid email address. The simplest method is to use the PHP built-in function filter_var (), which can check the email address. The code is as follows:Copy code Filter_var ('sgamgee @ example.com ',
Conclusion test environment:Ubuntu Server 14.04PHP Version 5.5.9-1ubuntu4Apache/2.4.7 (Ubuntu)PATH_INFO is a parameter in the SERVER Status. You can view the content through $ _ SERVER ['path _ info. In addition to PATH_INFO, the $ _ SERVER array
Before learning this method, we use the rmdir () function. This function deletes a file or folder based on the specified file path. However, when a folder is deleted, when there is still content in the folder, the Directory not empty error will
If we use the date function to obtain the number displayed on the date The code is as follows:Copy code Echo date ("Y-m-d ");?> Output2014-10-11If we wantOctober 11, 2014What should I do? Later I saw a friend write a sentence function. The
Socket Extension in windowsIn windows, you can directly modify the php. ini file to remove it.Extension = php_sockets.dllRestart with the semicolon.Install socket extension for PHP in linux The code is as follows:Copy code # Cd/home/php5.2.1/ext/
Method 1: upload a file using jquery ajaxfileupload. jsIn fact, it is to implement the upload of non-refresh files. The IFRAME file Upload principle can be used.In fact, when using PHP to upload files... You can only use $ _ FILES, but if we only
The implementation of php multi-process depends on the pcntl extension. During PHP compilation, you can add '-enable-pcntl' or compile it separately.Note the following three points:1. The sub-process does not execute the code before fork, but just
I. Front-endWhat is the engine used by Firefox and google? (At least the basics of the previous section, the compatibility of the browser for stream adjustment is required. It is also required to use CSS3 and HTML5)Firefox uses Gecko, while Safari
CURRENT TIMESTAMP The code is as follows:Copy code $ Nowcode = time ();$ Nowcode = strtotime (now ); Time stamp converted to date The code is as follows:Copy code $ Date = date ("Y-m-d", getdatecode ($ )); Convert date to timestamp The
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