Copy CodeThe code is as follows:
Ini_set ("Memory_limit", "50M");//must, according to the actual situation of your environment as large as possible to prevent errors
Ini_set ("Max_execution_time", "100");
The file_exists () function checks whether
First, the file upload
1. Client settings:
(1), in
Second, the file download
Simple file download only needs to use the HTML link tag, and specify the URL value of the attribute href to the downloaded file. This method
Singleton mode is the creation mode, which is the simplest mode in design mode, and its use is ubiquitous.
Singleton mode guarantees that a class has only one instance and provides a global access point to access it.
When you need to control the
Today, we suddenly find that we need to call the subclass in the parent class, which has not been used before, and can be found through practice. Examples such as:
Copy the Code code as follows:
/*** Parent class calls subclass method base class*
Using the Json_encode () built-in function in PHP (PHP > 5.2) can be used in PHP to communicate well with other languages and use it.
The function is to convert a numeric value into a JSON data storage format.
' Shia ', ' age ' =>20
1: Open the Phpmailer core file class.phpmailer.php, the public $CharSet = ' iso-8859-1′; Change to public $CharSet = ' utf-8′;
As for why to change ' iso-8859-1′ ' to ' UTF-8 ', please google or Baidu a bit ' iso-8859-1′ is clear.
2: Set the
PHP is known as dirty but Quick's programming language. Although the PHP program is not simple and beautiful for other programming language users, we can also make PHP's code look comfortable and elegant with some good programming habits. What are
One, take partial string.
Copy CodeThe code is as follows: String substr (string string, int start, int [length]);
This function takes the string starting at the start of the string to take a length character. If start is negative,
is calculated
Here we will analyze how to open and use the Smarty cache, how to clear the Smarty cache and Smarty Global cache, partial cache, local cache three kinds of caching mechanism.
First, open and use the Smarty cache
To turn on the Smarty cache, simply
Occasionally to use PHP to do some of the MySQL database operation Test, their own writing is too cumbersome, the results of the search generally contain a lot of useless code, here will PHP MySQL operation to summarize, I hope that later use when
Zend_db_adapter is the Zendframework database abstraction Layer API, based on PDO, you can use Zend_db_adapter to connect and process multiple databases, including Microsoft SQL Server,mysql,sqlite Wait a minute. To instantiate a Zend_db_adapter
Speaking of PHP code debugging, for experienced phper, through the simple Echo, Print_r, Var_dump function, or PHP development tools Zend Studio, EditPlus can very quickly solve most of the problems encountered in the work, But for the novice PHP
In PHP China to see a PHP code ridicule of the year-end summary, it is quite interesting to write, here also turn around. The programmer is to be funny, the mind is flexible, write this code of the buddy must be a very interesting person.
'
Recently did a small task, SMS, MMS, the mass function. The partner provides an interface, we just need to put the content to be sent into an XML, and then HTTP POST to that address on the line. Here is the use of the Curl Library, a simple record
PHP programming has been for two years, and now will usually summarize some of the more practical ways to improve the performance of PHP to do a summary and share, welcome novice onlookers, high finger is!
1. It is quicker to use single quotes
The first letter of each word is converted to uppercase: Ucwords ()
Copy CodeThe code is as follows:
$foo = ' Hello world! ';
$foo = Ucwords ($foo); Hello world!
$bar = ' HELLO world! ';$bar = Ucwords ($bar); HELLO world!$bar = Ucwords (Strtolower
The PHP smarty template has some simple variable handling functions by default. It basically satisfies most of the requirements of web development, but there are always some functions in the actual development that these basic functions cannot meet.
Smarty is a very popular template in PHP development, has previously sent an article PHP smarty Chinese interception plug-in development example is to explain how to develop Smarty plug-ins, this article will share how to do a for loop for 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