Php's method of starting with two underscores is called a magic method, which plays a pivotal role in PHP. Magic methods include: __construct (), class constructor __destruct (), Class destructor __call (), call to an inaccessible method in an
Almost all programmers involved in program development encounter time processing problems, PHP development is the same, fortunately PHP provides a lot about date and time functions. As long as the use of these functions, with the use of date and
To prevent SQL injection these details are usually in the effect of a programmer or a novice programmer, they did not have the data submitted by the user to do some very filter so as to cause the test for everyone to break your database, the
Static methods can be invoked in a non-static method of PHP
Class test{public
static function Strprint () {
echo ' This is strprint static function ';
}
Public Function Staticfuncinvoke () {
self::strprint ();
}
}
$test =
First, the concept: Two-point search also known as binary search, the advantage is that less than the number of times, the search speed, the average performance is good; its disadvantage is to request the table is ordered table, and insert delete
Some people say that PHP's unset does not really release memory, some say, PHP unset only in the release of large variables (a large number of strings, large arrays) when the real free memory, but also said that in the PHP level to discuss memory is
1. __construct () and __destruct ()
Invoked when an instance is created/destroyed, you can pass 0 or more parameters.
Class A
{
function A ()
{
echo "build A";
}
function __destruct ()
{
echo "destroy A";
}
}
$obj =
You can define a __clone () method in the object class to adjust the clone behavior of the object. The code for this method is executed during the cloning operation. In addition to copying all existing object members to the target object, the action
Anti-injection
When writing code today, it suddenly occurred to me that it was not possible to use a file to handle all the sites that might have been injected. This saves time and code by not filtering each variable in every program.
We are mainly
the function of PHP page jump is to jump one page to another page in the website. For a friend who has just learned the language of PHP, it is the basic method that must be mastered.
Page jumps may be triggered by a user clicking on a link, a
This article mainly introduces the use of socket GET and POST data instances in PHP. This article provides code instances for the GET and POST methods respectively. For more information, see
1. GET webpage content using PHP
The Code is as
In php, we can use the mb_detect_encoding function to check string encoding or file encoding. The mb_detect_encoding function is a built-in function of php. The following is a brief introduction. In php, we can use the mb_detect_encoding function to
Today, I am reading the $ _ GET function in W3C, which is limited to less than 100 characters, and some people can also see that it is less than 2 kb, in addition, we can see that the $ _ GET method has no length limit, because the amount of data
Go deep into the usage of var_dump in php. First look at the instance: Copy the code as follows :? Php $ aalsdflasdf; a; $ bvar_dump ($ a); echobr; var_dump ($ c); $ dvar_dump ($ c); echobr; echo $ a; echobr; echo $ B; ec
First look at the instance:
1. what is xml? XML (ExtensibleMarkupLanguage) can be used to expand the markup language. like HTML, it is SGML (StandardGeneralizedMarkupLanguage, standard common markup language ). Xml is cross-platform in the Internet environment... "> I. What is
PHP Get Week method Daquan Simple Introduction
PHP Gets the week method Daquan simple introduction, PHP week to get code:
1 Date ("L");
2//data can get English for weeks like Sunday
3 Date ("W");
4//This can get digital weeks like 123, note 0 is
Bool
Feof (
Resource $ Handle ):
Tests for end-of-file on a file pointer
The original words above the PHP manual.
I used this for convenience.
Code highlighting produced by Actipro CodeHighlighter
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.