Mysql_pconnect is used to establish a persistent connection between php and mysql. Generally, the execution mode of php is to initialize all resources when the script starts to be executed, and release all resources after the script ends. This is
Encryption and decryption is a common requirement in a system. PHP websites often use encryption and decryption. The following describes a useful encryption and decryption function, which will be used in the future.
'; echo 'decryption :'. encrypt (
Changing the size of an image is a common functional requirement. Next we will study how to change the size of an image in PHP. First, we will introduce a self-written function.
Imagecopyresampled
Imagecopyresampled -- Re-sample and copy part of the
Excel can easily process data. If the database data can be read into an excel file, it can be easily processed.
Convert database data to Excel excel. php
wirtetoexcel($path,$data); } function wirtetoexcel ($fn,$data) {
Sometimes we need to use PHP to delete files and folders. PHP also has functions to implement. Below is a simple record of the Code to facilitate future persistence. First look at the code
The unlink () function is used to delete objects. If the
Using PHP to determine the browser type is actually very easy. This is because when the browser connects to the server, it will first send some content containing its own information (such as the browser type and language ).
Here we mainly analyze _
For Web programming, the most important thing is to access and read/write data. There may be many storage methods, such as strings, arrays, and files. Array is an important method in PHP Data Applications. PHP has a large number of array functions.
Sometimes, when we enter a website from a search engine, there will be a line of small words, "welcome from Google/Baidu, by retrieving the" XXX "keyword to this site" and so on. How can this function be implemented? In fact, it is not difficult.
1. If a method can be static, declare it static. Speed improvement is by a factor of 4. If a method can be static, make a static Declaration on it. The speed can be increased to 4 times.
2. echo is faster than print. echo is faster than print.
3.
There are many methods for getting the extension name of an object. Here is an introduction.
The strtolower () function converts a string to lowercase.
The strrev () function reverses the string.
The strpos () function returns the position
Generally, during website development, a template or layout contains the appearance and layout of the entire website, which is generally divided into header, content, footer, and even menu. The content Part varies with different pages and functions.
A view is where you can view all your websites. They use a unified interface and can be modified as needed. One of the advantages of MVC is that you separate the presentation layer and the logic layer, and everything looks clean. A view is actually
You can simply write a PHP Image Upload file that supports jpg, png, gif, and other formats. If you want to support more formats, such as bmp, you can expand it by yourself. It is not object-oriented. Here we will record it for future use.
You can
I have found that many PHP programmers, especially those who have not studied PHP for a long time, do not know the essence of PHP. How did Perl become famous in the business world? Its powerful regular expression. What about PHP? He is a language
E/class/db_ SQL .php encapsulates an SQL statement. Using the class library of the program can bring convenience and efficiency to our development, and reduce the number of files added.
First, make the following preparations:
Create a test
To better demonstrate the way MVC works, we use a simple news article publishing system as an example. There are two methods: MVC and MVC. We will only give a basic demonstration, read some article lists from the database, and display them on the
Smart Tag (e: loop)
Format:
[E: loop = {topic ID/topic ID, number of items displayed, operation type, only title images are displayed, SQL conditions are attached, and sorting is displayed}] template code content [/e: loop]
Example:
[e: loop =
What is the Zend Framework MVC design pattern?
The Model-View-Controller (MVC) mode refers to the Model-attempt-Controller mode. Its core idea is to divide the entire program code into three components that are relatively independent and can work
Substr () function Introduction
The substr () function returns part of the string.
Syntax: substr (string, start, length ).
String: required. Specifies that a part of the string is to be returned.
Start: required. Specifies where the string
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