Some time ago, I took a closer look at the PHPCMS open-source system, which separated the program from the template and thought it was really good. I seldom pay attention to open-source systems, especially PHP. I think PHP itself is a huge function
During php development, you need to pay attention to some small security details, block error prompts, and consider more security issues.
1. do not rely on the registration of global variables function (register_globals)
Registration of global
PHP can be used to implement many functions. For example, during website construction, we often use webpage export data. Today we will introduce how PHP exports Word documents. Generally, there are two ways to export doc files, one is to use com,
Today, the entire php project has been completed, and many security issues have been raised. during the development process, parameters are not filtered out. Therefore, the following anti-injection program is indispensable for injection.
The code
Sometimes we need to know which search engine the user uses to access our page through a keyword. of course, js can also be implemented, but here we will introduce the php implementation code.
The code is as follows:
Greengnn codes
I found a problem that is easy to make mistakes, but does not understand the principle, but does not understand the problem. if you encounter a similar problem, you can refer to it.
The code is as follows:
Foreach ($ array as & $ row ){
$ Row =
Today I encountered such a problem. The processed array $ tempArray is in the following format (the key has been sorted ), next, we need to process the chunks based on this result. the method I use is to differentiate the chunks by key, assign the
To simulate the phphttp request class written by the xmlhttp component in asp, the basic functions are implemented. The gzip compression class name is supported: HttpRequest ($ url = "", $ method = "GET", $ useSocket = 0)
// $ Url indicates the
It can be seen from the name that there is a problem with the parameter you pass. that is to say, when you define the parameter to be passed, for example, mysql_query ($ query, $ result), these two parameters, you only use the $ query parameter. if $
PHPUnit is a lightweight PHP testing framework. It is a full migration of the JUnit3 series under PHP5 and a member of the xUnit Testing framework family (both of them are based on the KentBeck design of the model pioneer ). Unit testing is the
Developing PHP extensions may always be a mysterious task for common programmers. In fact, as long as you are familiar with the C language and understand the steps and rules for developing PHP extensions, developing PHP extensions is also a common
What you learn and do is published to facilitate your own reading and publishing. You are welcome to give your best advice.
The code is as follows:
/*
What you learn and do is published to facilitate your own reading and publishing. You are
Php uses ob_start to generate static pages. For more information about generating static pages, see. Although there are many methods, it is easy to use. I think we should first determine the difference between the generation time of the generated
In the first two articles in this series, PHP Unit Testing Tool: PHPUNIT preliminary study and PHP Unit Testing Tool: PHPUNIT in-depth usage (2, this section describes the basic usage of phpunit and some important usage of phpunit. In this article,
In PHP, exec is used to obtain the code with the unique identifier of the computer, and the CPU and Nic MAC address information can be obtained.
The code is as follows:
// Obtain the CPU information of the computer
Function OnlyU (){
$ A = '';
$ B
In php, the ip address resolution of qq is obtained remotely to obtain the geographic location code. For more information, see.
The code is as follows:
Function get_ip_place ()
{
$ Ip = file_get_contents ("http://fw.qq.com/ipaddress ");
$ Ip =
The conversion code between data types learned by php mainly solves the mutual conversion between some data types in php.
The code is as follows:
/* Data types are converted to each other
* Forced conversion
* SetType (variable, type); // int,
The questions encountered during the php interview are recorded here. For more information, see. Code Optimization
The code is as follows:
For ($ I = 0; $ I Array_push ($ week, $ arr );
}
The code is as follows:
For ($ I = 0; $ I $ Week
To solve the intersection problem of two arrays, you can use array_intersect (), array_inersect_assoc, and array_intersect_key. here, array_intersect () the function is used to calculate the intersection of two numbers and returns an array (only an
I have been tossing my website homepage recently. most of the PHP scripts I have written need to use operations related to the MYSQL database. I will share these methods with you today. I hope you can talk more about them!
I. database operations
1.
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