PHP comparison operators appear too frequently, especially =If (A = B ){// Do something}But have you really mastered =? Details are important!Let's take a look at the followingCode, Say the answer you think is correctVar_dump ('123fg456 '= 123 );Var_
Note:
Linux Server: CentOS 5.5
Web Environment: LAMP or LNMP
Windows Server: Windows Server 2003
Windows Server IP Address: 192.168.21.134
Database environment: SQL Server 2000 database
Database account: sa
Database Password: 123456
Objective: To
1. Call syntaxUse date () to obtain the current time format, for example:
2. Time Format parameter settingsIn the above syntax, "Y-m-d H: I: s" is displayed in the format of year-month-day hour: minute: SecondIn this case, we only need to obtain
We usually write phpinfo () When configuring the php environment. This function is used to test whether the php environment is successfully installed. However, this function also brings security risks to the system, so how can we turn off this
1. Getting Started
In short, regular expressions are a powerful tool for pattern matching and replacement. We can find regular expressions in almost all UNIX-based tools, such as the vi Editor, Perl or PHP scripting language, and awk or sed shell
Knowledge Point introduction:1. Determine whether a file or directory has a bool
Copy codeThe Code is as follows: file_exists (string filename)
2. Get the file nameCopy codeThe Code is as follows: basename (filepath)
3. open the fileCopy codeThe
Php object-oriented _ get (), _ set () Usage
In general, the class attribute is always defined as private, which is more in line with the actual logic. However, attributes are read and assigned frequently. Therefore, in PHP5, we predefine the two
Copy codeThe Code is as follows:
QR code generation -www.ibtf.net
$ Content = $ _ GET ['content'];
$ Width = $ _ GET ['width']? $ _ GET ['width']: 300;
$ Height = $ _ GET ['height']? $ _ GET ['height']: 300;
If ($ content ){
Echo "the
The binary method is used to check whether an array contains a certain element. It is compatible with positive and negative order. The code is implemented as follows:
Copy codeThe Code is as follows:
$ SearchValue = (int) $ _ GET ['key'];
Function
In the past, the object orientation was limited to the rote memorization model. After working for so long, it turned to be an experience for everyone to see.1. finalFinal: php5 adds a final keyword. If the method in the parent class is declared as
Apc definition: apc is an open and free php opcode cache. It aims to provide a free, open, and sound framework for caching and optimizing php intermediate code.
Common apc functions:
1. apc_clear_cache () Clear apc cache content
2.
// Filter parameters
// Filter cat_id = 2$ Cl-> SetFilter ("cat_id", array (2 ));// Search only for sub-forums with id 1, 3, and 7$ Cl-> SetFilter ("forum_id", array (1, 3, 7 ));
// Range Filtering// The filtering time is today, and the parameter is
Singleton mode: Simply put, an object is only responsible for a specific task.
Singleton class:1. the constructor must be marked as private. The Singleton class cannot be instantiated in other classes and can only be instantiated by itself.2. Have a
SetType-set the variable type
Bool settype (mixed $ var, string $ type)Set the var variable type to type.
The possible value of type is:
• "Boolean" (or "bool", starting from PHP 4.2.0)• "Integer" (or "int", starting from PHP 4.2.0)• "Float"
T1.php
Copy codeThe Code is as follows: // Method 1 generate a static page based on the template
// ReplaceTemplateString is used to replace the specified string in the template.
Function replaceTemplateString ($ templateString ){
// The variable to
Bool
Assert(Mixed $ assertion [, string $ description])-check whether an asserted is
FALSE
Copy codeThe Code is as follows: assert_options (ASSERT_ACTIVE, true); // you can use the assert () function.
Assert_options (ASSERT_WARNING, false); // no
The Code is as follows:
Copy codeThe Code is as follows: // The observed abstract class
Class Observed implements SplSubject {
Protected $ _ name;
Protected $ _ observers;
// Instantiate to generate an observer objectPublic function _ construct (){$
Copy codeThe Code is as follows:/*
-->
]/> -->
Sun Wukong
sun Walker
123
White Bone essence 140 introduction */$ Xmldoc = new DOMDocument ('1. 0', 'utf-8 ');$ Xmldoc-> load ('datas. xml ');
$ ItemsNodeList = $ xmldoc->
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