The knowledge in grammar structure textbooks is different from that in actual programming. Real knowledge must be obtained in actual development. Every PHP developer should be familiar with the following five things before developing a web
Then the article "High-quality PHP Code 50 Practical Skills Necessary (above)" continue to study.
26. Avoid writing SQL directly, abstractpatiently wrote too many of the following statements:
$query = "INSERT into the users (name, email,
It is very easy to teach to improve the quality of php code by 36. 1. do not use relative paths. you will often see: require_once (... libsome_class.php). This method has many disadvantages: it first looks for the specified php inclusion path and
Improvement of PHP code quality 36 1. do not use relative paths
We often see:
require_once('../../lib/some_class.php');
This method has many disadvantages:
It first looks for the specified php inclusion path and then finds the current directory.
1. Do not use relative pathsWe often see:
Require_once ('../lib/some_class.php ');
This method has many disadvantages:
It first looks for the specified php inclusion path and then finds the current directory.
Therefore, excessive paths are
Php code quality is greatly improved. For more information, see
1. do not use relative pathsWe often see:
Require_once ('../lib/some_class.php ');
This method has many disadvantages:
It first looks for the specified php inclusion path and then finds
It first looks for the specified php inclusion path and then finds the current directory. therefore, excessive paths are checked. if the script is included by another script, its basic directory is changed to the directory where another script is
1. Do not use relative pathsWe often see:Require_once ('../lib/some_class.php ');This method has many disadvantages:It first looks for the specified php inclusion path and then finds the current directory.Therefore, excessive paths are checked.If
From: http://www.redbots.cn/resources/2009/01/22/7386.htm
The latest statistics show that more than 20 million servers are running various PHP applications around the world. It is as good as Python and Ruby! PHP is highly efficient and practical.
1. Do not use relative pathsYou will often see:
Require_once ('.. /.. /lib/some_class.php ');
There are many drawbacks to this approach:
It first finds the specified PHP include path, and then finds the current directory.
Therefore, too many paths
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.