PHP rename: Change the file and folder name

Command Format: Bool Rename (string oldname, string newname [, resource context]) The following demonstrates the specific rename application: File Location Purpose: 1.change cache.txt to rename.txt; 2.change cache2.txtname to cache3.txt 3.

Principles of PHP string traps

A string is series of characters. String access and modification by character Characters within strings may be accessed and modified by specifying the zero-based offset of the desired character after the string using square array brackets, as in $

Animation and code sharing of php dll call instance operations

The original code in the animation is as follows: Copy codeThe Code is as follows: VERSION 1.0 CLASS BEGIN MultiUse =-1 'true' Persistable = 0 'notpersistable DataBindingBehavior = 0 'vbnone Performancebehavior = 0 'vbnone MTSTransactionMode = 0

Single index. php implements PHP folder traversal at any level (original Zjmainstay)

The following are core files: Index. php file Copy codeThe Code is as follows: Header ('content-Type: text/html charset: UTF-8 '); Date_default_timezone_set ('prc '); $ RootDir = 'listfile'; // the root directory of the site to load all files of the

Php cutting page div content implementation code sharing

Highlights: 1. You can also use php to cut the page div. We hope that readers can provide more perfect solutions. 2. The cut processing method has been encapsulated into a method and can be directly referenced. 3. Tag Cloud interception. //

Share some array sorting methods in php

A. Internal sorting (directly loaded to memory for sorting): including swap sorting (bubble and quick), selective sorting, and plug-in sorting B. External sorting (because the data volume is large, external storage is needed for sorting): including

Php generates a thumbnail code

Although the width and height of an image can be specified in HTML to scale the image at will, this method does not reduce the number of pixels of the image. The size of the image file has not changed, and of course the image download speed will not

Allows PHP to provide faster file download code

However, in this way, we can't do some statistics, permission checks, and so on. So, in many cases, we use PHP for forwarding to provide users with file downloads. Copy codeThe Code is as follows: $ File = "/tmp/dummy.tar.gz "; Header ("Content-type:

PHP serial number generation function and string replacement function code

Copy codeThe Code is as follows :/** * Serial number generator */ Function snMaker ($ pre = ''){ $ Date = date ('ymmd '); $ Rand = rand ); $ Time = mb_substr (time (), 5, 5, 'utf-8 '); $ SerialNumber = $ pre. $ date. $ time. $ rand; // Echo

Implementation and explanation of Regular Expressions for email addresses in php

First, attach the code Copy codeThe Code is as follows: ^ [_. 0-9a-z-] + @ ([0-9a-z] [0-9a-z-] +.) + [a-z] {2, 3} $ In this regular expression, "+" indicates that one or more strings appear consecutively. "^" indicates that the next string must

Highlights of PHP interview questions compiled by NLP

PHP Basics 1. Evaluate the value of $Copy codeThe Code is as follows: $ a = "hello ";$ B = & $;Unset ($ B );$ B = "world ";Echo $; 2. Evaluate the value of $ BCopy codeThe Code is as follows: $ a = 1;$ X = & $;$ B = $ a ++;Echo $ B; 3. Write a

PHP Excel implementation code for reading Excel files

Knowledge points: Php reads excel files cyclically Php encodes the characters in ascii format and converts the characters into decimal numbers. Php reads the excel Date Format and converts it to display Php encodes Chinese characters with garbled

Analysis of PHP mcrypt Reversible Encryption Algorithm

Data Encryption has become more and more important in our lives, especially considering the large amount of data that has been traded and transmitted over the Internet. For information that does not need to be restored to the original data, we can

Summary of nine common functions for PHP Development

1. Any number of parameters of the Function You may know that PHP allows you to define a default parameter function. But you may not know that PHP also allows you to define a function with all arbitrary parameters. The following example shows the

Php dirname (_ FILE _) to obtain the absolute path of the current FILE

For example, the current file is placed under (d: \ www \) and the file name is test. php. The test code is as follows: Copy codeThe Code is as follows: Echo _ FILE _; // obtain the absolute address of the current FILE. Result: D: \ www \ test.

PHP session validity period session. gc_maxlifetime

A known method is to use session_set_save_handler to take over all session management tasks. Generally, session information is stored in the database, so that all expired sessions can be deleted through SQL statements, precisely control the validity

PHP learning variable usage Summary

1. Define ConstantsDefine ("CONSTANT", "Hello world ."); Constants can only contain scalar data (boolean, integer, float, and string ). When calling a CONSTANT, you only need to obtain the CONSTANT value with a simple name, instead of adding the "$"

Use regular expressions in PHP to clear blank strings

You can use the PHP internal function trim () to remove the leading and trailing spaces of the string (). However, we often want to completely clear the blank. You need to clear the white spaces at the beginning and end, change multiple white spaces

Php Attack Protection Code upgraded

However, these attacks have suddenly become terrible in recent days, and 90% of the attacks cannot be blocked. Please refer to the daily statistics: IP attack and start time Number of attacks Location Remarks

Sort common Regular Expressions in PHP

----------------------------------------------------------- Regular Expression collection Mobile phone number:$ Mode = "/^ 1 [358] \ d {9 }/"; Email Address:$ Mode = "/^ [a-z] [-_ \.]? [A-z \ d] * @ [a-z0-9] + [\.] [a-z] {2, 4}/I "; ----------------

Total Pages: 12780 1 .... 2435 2436 2437 2438 2439 .... 12780 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.