Code that complies with the following six principles is generally considered to be extensible, maintainable, and highly reusable code:
1. Principle of single responsibility
Don't meddle.
2. The principle of open closure
Open to extension, closed for
$v) {
$array [$k] = sec ($v);
} else if (is_string ($array)) {//Addslashes function is used to process $array = Addslashes ($array);
else if (Is_numeric ($array)) {$array = Intval ($array);
return $array; }//Integer filter functions
PHP is a useful function parse_url, especially convenient for the analysis of information capture. Examples are as follows: Copy code code as follows:
$url = "http://www.electrictoolbox.com/php-extract-domain-from-full-url/";
$parts = Parse_url
In order to solve the problem of the introduction of multiple file pages and difficult to manage, PHP provides several automatic loading file scheme, which will be introduced hereAutomatic load best to do class name and filename one to, Master pass
Reprint please specify the Source: PHP Programmer to master what technology
There are always a group of people, learn a half-baked is anxious to find a job, face the question can not come out, bragging can not blow so you only low wages.
Before
When using AJAX to interact with the background, we often encode and decode Chinese, and for JS there are two functions: encodeuricomponent for encoding, decodeuricomponent for decoding. For PHP in the background, there are two corresponding
Linux installation php-7.0.16, complete PHP and Apache configuration
Version: php-7.0.16.tar.gz,libxml2-2.9.2.tar.gz (PHP needs its support, install it first)
Description: Install Apache blog, complete PHP and Apache configuration, on a blog
Website development process often meet the next issue of the processing, today just in the time to do a project also encountered, this is the improvement of their previous methods, there may be no consideration of the problem, please you can improve
Reprint: http://www.lamper.cn/html/2007/03-21/61.html
1, using PHP to describe the data conversion
The conversion of decimal N and other D-ary numbers is the basic problem of computing implementation, and there are many solutions, one of the simple
PHP developers often encounter this situation, the development of the language is sometimes 5.3, sometimes 5.6. You can't always reinstall PHP every time you switch versions.Fortunately there is a solution, that is, in the system to compile multiple
Recently in learning Laravel, using a newer version of PHP, did not go to install homestead, this machine is Wamp, but wamp with the PHP is 5.5.2, so I want to get a multiple version out.
First up Effect chart:
Steps: 1, download the latest
The environment for this article is linux+php+apache+mysql.
profile/Startup command
PHP's configuration file is:/etc/php.ini.
The Apache configuration file is:/etc/httpd/conf/httpd.conf
The MySQL configuration file is:/etc/my.cnf.
you need to
In the PHP code to use the session is a very normal thing, but, often there will be warning, probably meaning what can not find the session of the temporary Save directory or have no access to read and write. And most of the online solutions are to
Migrating items to Ubuntu under a single project found that the following links do not normally access
Http://127.0.0.21/Home/Public/login
Opened the rewrite also not, and later by the parties to find information to solve
DocumentRoot
Recently, as a result of the project needs, from a front-end to the back end, have to do the backstage work. Think of me as the great goal of the whole stack of engineers, more determined their own drive. Although I have seen Nodejs before, but
1.tpl
{block name = ' title '}{/block}
{block name = ' Content '}{/block}
{block name = ' footer '}{/block}
2.tpl
{extends file= ' 1.tpl '}
{block name= ' title '} I am the title {/block}
{block name= ' content '} I am the contents
the command line executes the PHP script with parameters and gets the parameters
Published in 2011-07-15
Category directory: PHP
One, why do we run PHP scripts at the command line?
Personal understanding, there are two main reasons:
1, using
There are 2 ways to output static pages with PHP
One is the use of templates
Technology , and the other is using OB series functions. Both methods look the same, but in fact, they are different.The first: the use of templatesThe current PHP
A problem that has wasted hours of my time is simple.A simple code
$dir = "temp";
mkdir ($dir, 0755);
Prompted me to permission denied.
I tried to change the parent folder permissions, recreate the folder, change the permissions, move the file,
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