Data caching
Here is the data cache refers to the database query cache, each visit to the page, will first detect the corresponding cache data exists, if not, connect the database, get the data, and the query results serialized after saving to the
The code is as follows
Copy Code
function Funcmtel ($STR)//mobile number Regular expression test{Return (Preg_match ("/(?: 13d{1}|15[03689]) d{8}$/", $str))? True:false;}
Test
18678785887
Return to
False
Cause analysis,
RmDir Delete Empty Directory
The code is as follows
Copy Code
?To delete a directory using the RmDir function$dirname = "Mydir"; Defining variablesRmDir ($dirname);?>
Delete directory successful reaction ture,
By default, the PHP instruction MAGIC_QUOTES_GPC is on, and it automatically runs Addslashes () for all get, POST, and COOKIE data. Do not use Addslashes () on strings that have been escaped by MAGIC_QUOTES_GPC, because this can result in a double
Learning Purpose: Learn to upload files and email in PHPUpload file form must add Enctype= "Multipart/form-data"and
Let's take a look at the code:
$f =& $HTTP _post_files[' file '];$dest _dir= ' uploads '/set upload directory$dest = $dest _dir. '/
The
PHP Framework series will introduce three widely used PHP frameworks--zend, Symfony, and cakephp--to study the similarities and differences of three frameworks by building and extending sample applications in three frameworks. Part 1th will
If you've ever downloaded widgets for your UNIX system, you must have encountered the tar compression file. The tape archive file format is often used in UNIX systems to package multiple files to facilitate the distribution of KVM.
This format is
In interaction with the user, the front end of the long text in theory allows the user to use the expression, but the current end of the expression to the background interface, due to some of the data coding restrictions, there is no way to save
Illegal Chinese characters can affect the display and even the execution of programs, and there are some unexpected results. So we need to filter these illegal Chinese characters or characters. Code as follows
code is as follows
Today, I saw a friend Upload directory on a server configured in this way:[Root @ Centos62 ~] # Chomd-R-x uploadScared me, and I said, "do you do this in general ?"Friend: "Yes! The x execution permission has been revoked. You cannot execute any
Zabbix monitoring logs have been configured many times before, and many items have been monitored. However, my website does not have this content. I will fill in this item today. Today, we will take an example of an error reported by php in
PHP and JAVAJAVA is a very powerful programming tool and its extension Library is also very useful. This tutorial mainly describes how to use PHP to call a powerful JAVA Class Library (classes ). For your convenience, this tutorial will include JAVA
Zend Opcache configuration methodZend Opcache has been integrated into PHP 5.5. When compiling and installing PHP5.5, add -- enable-opcache. But it also supports earlier versions of PHP 5. 2. *, 5. 3. *, 5. 4. * in the future, the 5.2 support will
If you use the wamp integrated installation environment, your php configuration is at D:/wamp/bin/apache/Apache2.2.17/bin.You need to copy and overwrite php under D:/wamp/bin/php/php5.3.3. ini. Otherwise, an error such as Fatal error: Call to
The sorting process is as follows:49 38 65 97 76 13 2738 49 65 97 76 13 27 compare the number of 1st and 2nd, Small put the front side, large put behind 38 49 65 97 76 13 27 compare the number of 2nd and 3rd, small front side, large back side 38 49 6
// Here, $ res is an array, but the dimension of the array is not fixed. In this case, the count function cannot be used. The code is as follows:Copy code // Array_filter () will delete all entries in $ res that are equivalent to FALSE$
In the Fckeditor editor, a page break is inserted. Click this button to insert a page break in the content area, marked in red as follows:The html code generated by the pagination operator is: The code is as follows:Copy code The actual
PHP is very powerful, and you can use it to do almost everything. Without complex variables and code, you can quickly make beautiful counters. Next, let's do it step by step.In fact, the principle of counting is that, first, a log file, such as
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