When we write programs, we always want to make our programs take the least amount of resources, run faster, and have less code. We often lose a lot of things while pursuing these. Now I want to talk about my understanding of PHP optimization. The
Topic: Find the error in the following code: Function baz ($y $z) { $x = new Array (); $x [ Sales] = 60; $x [Profit] =: foreach ($x as $key = $value) { &nbs p; echo $key + "" + $value + ""; } } How many can you find?
Define ("Mysql_open_logs", true);
Class Mysqlihelp
{
Private $db;
Public Function __construct ()
{
What to do if you want to query log logs
}
Public Function __get ($name)
{
echo "__get:", $name;
if (In_array ($name, Array ("DB"), true)//Isset ($
1. File directory operation
The top stop record is the disk root directory, with '/' or '/'
Current directory./
.. /Represents the Apache directory, the Htdocs directory
1. Create and delete directories mkdir
Copy Code code as follows:
The example in this article describes the PHP error and exception handling function module. Share to everyone for your reference, specific as follows:
First, the type of error and basic debugging methods
Errors in PHP programs are typically
Recently changed a new server, because the memory is 8G, so changed Windows Server 2008 R2 This system, although a little strange, but familiar with the feeling performance is very good, but after configuring the PHP environment but found the
Step one: Download the PHP 5.2 for Windows installation package and extract it to C:\php. Note that this decompression directory can be under any disk, but the directory name cannot contain spaces;
The following is the php5.2 file directory:
c:\php
This article describes the PHP implementation of the clue two-fork tree and Binary tree traversal method. Share to everyone for your reference, specific as follows:
createthreadtree ();
echo $tree->threadlist (). "\ n"; two-fork Tree
Free mobile phone number attribution to the API query interface and PHP use instance to share
Recently in the national Industry classified information Web site, need to use the mobile phone number attribution to display function, so the shuttle in
PHP itself is not timed function, PHP can not be multi-threaded. PHP's timing tasks must be combined with other tools to achieve, such as WordPress built-in Wp-cron features, very powerful.
First, the Linux server using crontab timed to execute PHP
Different from JS Cross-domain, IFrame Cross-domain, and other common processing methods, can also use P3P to achieve cross-domain.What's P3P?P3P (Platform for privacy Preferences) is a privacy protection recommendation published by the Consortium
We move the simple routing parsing and execution from the portal file public/index.php to the framework. The entry file suddenly became very refreshing ~ ~ ~ But, to our controller, we will see the following code:public function Actionview () {$body
When doing a look at the Internet café, because the page has a movie search function (user input)
This function can not be made static, then only dynamic, with the dynamic of the database, server pressure will bring a great test
So there's only a
PHP with APC implementation upload progress bar, has always thought that PHP is unable to achieve a dynamic function of the progress bar, the original or their own knowledge is not enough, see the APC extension related to some articles, the use of
Encrypt | page
First, IntroductionAlthough in general, your site is often fairly simple and does not require a database at all, in some cases your site may want to restrict access to certain pages. Generally, this means using a database to store
Project on the home page to see a article PHP to do the pros and cons of Web projects, their own also to nonsense a few words.
In fact, PHP is a very good tool, it can be simple, but also can be complex. Different items should be used in a different
Echo!isset (get[′a′]); If the value of variable A is not Echoempty (_get[' a ']); If the value of variable A is null Is_null, empty, isset, unset Let's take a look at the descriptions of these 4 functions first.
Isset determine if a variable
Suppose there are 10 sites, distributed around them, with their inventory synchronized, and the database does not support remote connections.
We have to get the inventory of the server in real time, there are many ways to do it, and I know the
For PHP application speed, speed up, and then speed! , part 1th: Improving performance and throughput using opcode caching software
In a very short time, PHP became a very popular programming language for developing WEB applications. For beginners,
With the new language features of PHP V5, you can significantly improve the maintainability and reliability of your code. By reading this article, you will learn how to use these new features to migrate code developed with PHP V4 to PHP V5.
PHP V5
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