Used today in the project to remove the last character in the string
The original string 1,2,3,4,5,6,
Remove the last character "," and the end result is 1,2,3,4,5,6
The code is as follows:
Copy Code code as follows:
$str = "1,2,3,4,5
This example describes how PHP imports Excel into the database and database data into Excel. Share to everyone for your reference. The implementation methods are as follows:
I. Import
The import needs to use the component that can read Excel, also
Re-understanding Unicode and UTF8 encoding
Until today, to be exact, I just realized that UTF-8 encoding and Unicode coding are not the same, and that there is a difference between embarrassingThere is a certain connection between them, to see the
Using the object-oriented knowledge of PHP to design a graphics calculator, but also the use of abstract knowledge, the calculator can calculate the circumference and area of the triangle, as well as the circumference and area of the rectangle. This
What is Snoopy? (Download Snoopy)Snoopy is a PHP class that mimics the functionality of a Web browser, which completes the task of getting web content and sending forms.Some features of Snoopy:* Easy to crawl the content of the Web page* Easy to
This article illustrates the method of dynamically adding URL query parameters to PHP. Share to everyone for your reference. The specific analysis is as follows:
This code can dynamically add key-value query parameters to the URL, and if the
Copy Code code as follows:
/**
* Adapter Mode
*
* Convert the interface of a class to another interface that the customer expects, and those classes that are not compatible to work together can work together
*/
This is the original type.
PHP predefined 6 interfaces are described below:
1.Traversable Traversal Interface
Oh! In fact, it is not an interface that can be used in PHP, internal classes can be used, it has a purpose is to detect whether a class can be traversed.
1, Super simple page Caching
If your project is not based on a CMS system or framework, creating a simple caching system will be very real. The following code is simple, but it can solve the problem for small web sites.
Copy Code code as
function bool Array_multisort (array & $arr [, Mixed $arg = Sort_asc [, Mixed $arg = Sort_regular [, mixed $ ...]])
Parameter description: function to sort multiple arrays or multidimensional arrays
The first argument is an array, and each
The example in this article describes how PHP realizes the conversion of Arabic and Roman numerals to each other. Share to everyone for your reference. as follows:
3999 | |
$f 1000, ' D ' =>, ' C ' =>, ' L ' =>, ' X ' =
>, ' V ' => 5, ' I '
This article illustrates how PHP saves pictures as different sizes of picture classes. Share to everyone for your reference. Specifically as follows:
Picture processing class. Imagecls.php is as follows:
$this->max_size) | |
( -1 = = $this->
This article illustrates how many palindrome numbers are in the middle of a two-digit PHP output. Share to everyone for your reference. The specific analysis is as follows:
"Palindrome number" is a number. such as: 98789, this number is reading is 9
Next () Definition and usage
The next () function moves the pointer to the current element to the position of the next element and returns the value of the element.
If the internal pointer already exceeds the last element of the array, the
This example describes how PHP separates file directories and file names from the full file path. Share to everyone for your reference. The specific analysis is as follows:
The basename () function is used to get the file name from the pathThe
This example describes how PHP obtains the file size and file creation time. Share to everyone for your reference. The specific analysis is as follows:
PHP can display various properties of the file, including the file's last access time, last
For a PHP array, how do you delete the first element or the last element of the array? In fact, these two processes can be done with the functions of PHP array_pop and Array_shift to complete, the following is a specific description of how to
Mind Mapping
Introduced
To undertake the previous PHP chat "refactoring-improve the design of the existing code" to rearrange your function to continue refactoring aspects of the content.
This chapter mainly aims at the
PHP compresses HTML page code (clears spaces, line breaks, tabs, comment marks).
A good way is to compress HTML, compressed HTML is actually: Clear line breaks, clear tabs, remove the annotation tag. The role it plays cannot be belittled.
PHP is
The example in this article describes how PHP gets file MIME types. Share to everyone for your reference. Specifically as follows:
1. Using the Mime_content_type method
String Mime_content_type (String $filename)
Returns the MIME
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