Good PHP code should be structured. Large sections of code should be divided into functions, methods, and those small pieces of code should be annotated, in order to understand their use later. And should be as far as possible to the foreground code
You can download the IP Location Extension class library at the http://www.thinkphp.cn/extend/223.html of the official website, or the extension class is already included in the download extension package (http://www.thinkphp.cn/down/253.html). If
Today in the export of Excel, always to test the exported Excel file, frequent download and open, very troublesome to write a segment code one GO server export excel==> download Excel file to local ==> and open the operation. Here is the solution to
PHP has a built-in Php_strip_whitespace method for reading php files and removing whitespace and comments from the code, but does not support direct read content removal of whitespace and annotations, and the following method supports reading string
Introduction and working principle of fastcgi the first simple introduction of the fastcgi:fastcgi is a language-independent, scalable structure of the CGI open extension, the main behavior is to keep the CGI interpreter in memory and thus achieve
Daemon Daemon Process
This is another interesting concept, daemon in English is "elf" meaning, as we often see in the Disney animation, some can fly, some will not, often around the protagonist of the cartoon, involved saga to mention some advice,
Remove duplicate values from an array, you can use the Foreach method, or you can use the Array_unique method, both of which use the following code.
"; $intStart 1 = time (); $arrRS = Array_unique ($arrT); $intEnd 2 = time (); $intTime 2 =
The concept of XSS does not have to say, its harm is great, which means that once your website has an XSS vulnerability, you can execute arbitrary JS code, the most frightening is the attacker to use JS to get a cookie or session hijacking, if this
Upload Avatar, interface no jump way a lot, I used to add an iframe that kind. Directly below the code.
Html:
Copy CodeThe code is as follows:
The route is the back-end interface
Upload/avatar the saved address for the uploaded
The so-called task plan is the computer automatically call the user pre-set application, so as to simplify the purpose of user operations. With the Task Scheduler for Windows 2000 (rather than the Cron program under *nix, which is no longer detailed
getimagesize function Get image size (PHP 4, PHP 5)
Array getimagesize (string filename [, array &imageinfo])//note ¥Imageinfo in use does not need to be in front of &.
DescriptionThe getimagesize () function will determine any GIF,JPG,PNG,SWF,SWC,
PHP Session FAQ Collection and solutions:
1.
Error hints
Warning:cannot send session Cookie-headers already sent
Warning:cannot Send session cache Limiter-headers already sent
Analysis and Solutions
The reason for this type of problem is that when
Grammar:
Copy CodeThe code is as follows:
Void Header (String $string [, bool $replace =true [, int $http _response_code)
Send the original HTTP header to the client
Be aware that:
The header function must be called before any actual output,
Getenv (PHP 4, PHP 5)
Copy CodeThe code is as follows://getenv-Gets the value of an environment variable
Function Description:String getenv (String $varname)Copy the Code Code as follows://Gets the value of an environment variable.With Phpinfo ()
When PHP accepts information submitted through an HTML form, it saves the submitted data in a global array, and we can call the system-specific array of automatic global variables to get those values. The usual automatic global variables are as
Copy CodeThe code is as follows:
Formatted date
static function FormatDate ($format, $datetime, $week = 0) {
$datetime = $datetime > 3000? $datetime: Strtotime ($datetime);
if ($week) {
$weeknames = [
' Day ',
' One ',
' Two ',
' Three ',
' Four ',
'
Found on the MySQL help document when looking for Mysql_pconnect, which is recorded here.
Web server uses PHP to generate a Web page with the following three kinds of three-way:
One: Use PHP as a CGI Wrapper. In this way, each request to reach the
PHP Error Interface detailed instructions, PHP error details
One of the most common errors on the Web is the invalid link. Once an invalid link appears from another site, you will reschedule yourof the site. People will store their favorite sites
Copy CodeThe code is as follows:
Heap Sort Application
Class Heapsort
{
var $a;
function SetArray ($a)//Get array
{
$this->a= $a;
}
function Runvalue ($b, $c)//$a represents an array, $b represents the sort heap, $c represents the end
Examples of using Curl_multi series functions in PHP
Believe that many people on the PHP manual vague curl_multi A family of functions headache unceasingly, their documents are few, give the example is simple so that you can not learn, I have been
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