PHP is a server-side scripting language used to develop dynamic Web applications. There is no good server-side debugging tool that is one of its limitations compared to Java. Usually we are in the PHP code to add Echo, var_dump and other statements,
Tonight, when you write the form validation class for the framework, you need to determine whether a string length is within a specified interval, and naturally think of the strlen function in PHP.
The code is as follows
When we write data to MySQL, for example:
Copy the Code code as follows:mysql_query ("Update table set ' title ' = ' Kuhanzhu ' s blog ')";That's going to go wrong. As with ASP, the database will be allergic to single quotes. And addslashes at this
On the internet to find a lot of ways to forge client source IP with curl, almost all using the Curl function, and later verified that the use of this function is powerful, not only can forge the client source IP can also forge proxy IP Oh, let's
What you need to extract is as follows:
Copy the Code code as follows:Http://baidu.com This is the first a-label,Growth footprints-focus on Internet development This is the second a-label.Http://www.jb51.net This is the first URL address that needs
1. Namespace: Similar to the namespaces in C + +, the same is true in order to avoid name collisions that can be caused by referencing more third-party libraries. Through namespaces, even though the names of the two classes are the same, they can
1.PHP Timestamp function converts date to UNIX timestamp
World Doomsday Timestamp PHP
The code is as follows
echo "Doomsday timestamp:". Strtotime ("2012-12-21")
2. Convert timestamps to System time
Defining the Encoding
AtomCssJavascriptJPEG ImageJsonPdfRssText (Plain)XmlOkSet a 404 Header:Set address to be permanently redirectedGo to a new addressFile Delay Steering:print ' You'll be redirected in ten seconds ';Of course, you can also use
Magic function
__construct ()
Called when an object is instantiated, and when __construct and a function with the name of the class name are present, __construct is called and the other is not called.
__destruct ()
Called when an
The 1th type of notation:
Copy CodeThe code is as follows:
Str_replace ("n", "', $str);
?>
The 2nd type of notation:Copy the Code code as follows:
Str_replace ("RN", ", $str);?>
The 3rd type of notation:Copy the Code code as follows:
Copy CodeThe code is as follows:
/**php language is support object-oriented programming, for object-oriented programming, learn Java and C + + people know Ah!
* If you are not clear to Baidu to ask about it.
*/
Let's define a class that defines
Using PHP for two days Snoopy this class, found very useful. Get all the links in the request page, use Fetchlinks directly, get all the text information using Fetchtext (which is handled internally or using regular expressions), and more features
Copy CodeThe code is as follows:
Class helper_spell{
Public $spellArray = Array ();
static public Function GetArray () {
Return Unserialize (file_get_contents (' pytable_without_tune.txt '));
}
/**
* @desc Get the first letter of the string
*
Copy CodeThe code is as follows:
Simulating SQL data
$array = Array (0=> ' apple ',1=> ' banana ',2=> ' cat ',3=> ' dog ',4=> ' egg ', ' 5 ' = ' father ');
Function Usage 1
Arr is an incoming data $con is a condition
function F_1 ($arr, $con)
When developing a system using the PHP OO model, it is often customary to store the implementation of each class in a separate file, which makes it easy to reuse the classes and facilitate future maintenance. This is also one of the basic ideas of
Note the text in the comments section Oh ~
Copy CodeThe code is as follows:
Instantiate an array
$array = Array ();
The array consists of two parts as follows
Array (key name [key]=> value [value])
Key names are commonly used with indexes
type can
Wsdl
WSDL (Network Service Description Language, Web Services Description Language) is an XML-based language that describes Web services and how to access them. This document can describe a WEB service. It can specify the location of the service and
After loading the PHP5 you will find this problem:
You may find that the output time is not the same as your current time.
The reason is that if you do not set your server local time zone in the program or configuration file, the time taken
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