1. Memory_get_usage function
int Memory_get_usage ([bool $real _usage = false])
Memory used by PHP scripts (without the memory of the Memory_get_usage () function itself)Memory_get_usage () parameter $real_usage, default is FALSE, and when set to
Expand
We need to open GD extension, you can use the following code to see whether to open GD extension.
Then find the GD option on the browser to Ctrl+F verify that you have not installed this expansion, if not, you also need to fully install this
This article mainly introduces the method of thinkphp to realize the check-in function, and analyzes the construction of MySQL data table and the concrete realization technique of thinkphp check-in function, which can be referenced by friends.
In
code examples for the PHP watcher pattern
observerlist[] = $obs;} Public Function Detach (Observer $obs) {$this->observerlist = Array_diff ($this->observerlist, [$obs]);} Public Function Notify () {foreach ($this->observerlist as $ol) {$ol->update (
single principle of responsibility
Definition: Do not have more than one cause for class changes. In layman's terms, a class is responsible for only one responsibility.
The principle of the Richter replacement
Definition 1: If you have an object
In many cases, we need to directly manipulate the files on disk in our development process, which is unavoidable in programming, and the following code describes how to recursively delete files on disk:
The only needs to pass in the path of the
Wamp Common Environment Configuration
Preface: Wamp often requires a customized configuration when used, and several common configurations are described here.
Customizing the Site Directory
Modify Directory Location
For example, open the httpd.conf
1. Full page static cache
That is, the page is all generated HTML static page, the user accesses the static page directly, but not to go to the PHP server parsing process. This way, in the CMS system is more common, such as dedecms;
A more common
This article mainly describes the PHP calculation for nearly 1 years of all the months of the instance. Has a good reference value. Let's take a look at the little series.
If you don't say much, look at the code:
$z = Date (' y-m '), $a = date (
In Wikipedia, the definition of a namespace is: the namespace (English: Namespace) represents the context of the identifier (identifier).
An identifier can be defined in more than one namespace, and its meaning in different namespaces is
One, decimal (number of points) cannot be directly compared for equality
For example, if (0.5+0.2==0.7) the result is false. The reason is because PHP is based on C language, and C language because of the second number of binary notation,
Memcache is a more commonly used method of caching in PHP development, and is an essential component in high concurrency systems.
In the actual development, memcache there is a more unsatisfactory problem, that is, memcache can not support the group
In the process of using PHP to use the header and Setcookie two functions, these two functions will send a file header information to the browser, but if the two functions before the use of any output (including null output, such as space, carriage
The following small series for everyone to bring a PHP Set cookie HttpOnly property method. Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.
HttpOnly is an
Disney has a famous animated film "Cooking Rat King", the protagonist is a little mouse remy, it cooked like a model, comparable to professional chef. Similar to this: PHP beginners want to be successful in this aspect, the advanced method is very
The following small series for everyone to bring a PHP detection data types of several methods (summary). Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.
In
In the previous section we have simply mentioned that recycling may have subtle performance effects on the root, but this is when comparing PHP 5.2 with PHP 5.3. Although in PHP 5.2, the record may be slower than the root at all, and other
In
PHP development , sometimes we encounter
rounding operations, this article shared the 3 methods of
rounding with PHP .
PHP Implementation rounding three methods, respectively through the Number_format function, round function and sprintf
The main first gets the path of the current directory, and then determines whether the folder exists and does not exist to create.
Define (' Dir_root ', str_replace (' \ \ ', '/', dirname (__file__)));//Gets the current file physical path
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