Always want to standardize their own PHP code, and finally realize the birds ~
0. Encoding Unified use Utf-8
1. Indent: Strict indent, 4 spaces (TAB)
2. Curly braces: The statement block below the IF statement, no matter how many lines, the
I have always been in the style of PHP functions to write PHP, all variables, functions, classes are used lowercase, the word between the lines separated, has been compared to exclude the Hump code specification, the person think in the case of the
Connect to MySQL:
Mysql_connect ():
$dbc =mysql_connect ($host, $user, $password);
Select the current database:
mysql_select_db ($database _name);
mysql_select_db (' $database _name ', $conn);
eg
If the function cannot
First, the tools.
Zend Guard 5.0. Version 1, compiled files, can only be run in the Zend Optimizer (current version 3.3.3) environment installed.
Zend Guard 5.5.0 or later, the compiled file can only be run under the Zend Guard Loader (current
1. PHP can read a random string This code creates a readable string that is closer to the word in the dictionary, and is practical and has password validation capabilities. /************** * @length-length of random string (must be a multiple of 2) *
Introduction: This is the PHP basic function of the detailed page, introduced and PHP, related knowledge, skills, experience, and some PHP source code and so on.
class= ' pingjiaf ' frameborder= ' 0 ' src= '
This example is briefly described in the previous article.
OK, let's start with the login page of the first page.
Or look at the interface
How do you really want to guide it in the end is how to achieve it? OK, let's look at the code:
1
2
In fact, the focus of the article is put on how to configure PHP xdebug environment, after all, the environment, like Netbeans,eclipse such an IDE, any can do PHP debugging.
Operating Environment:
Os:ubuntu 10.04
Server:xampp 1.7.3a
1.
Basic type
Back to Home
1, Boolean type Boolean:The value can be true or false. To explicitly convert a value to a Boolean, use either (BOOL) or (Boolean) to cast.
"; Var_dump ($a _bool); echo ""; Var_dump ((BOOL)" "); BOOL
1. Flush
Refreshes the contents of the program cache and outputs it to the browser.
2, Ob_start open the output buffer.
When the buffer is active, all non-file header information from the PHP program is not sent, but is saved in the internal
PHP and JavaScript are also dynamic languages, but there are many differences between them. Compare here.
JavaScript PHP
variable names can start with a $ or letter
variable names must begin with $
The
? From: http://www.cnblogs.com/mrray/archive/2011/05/18/2050233.html
Strtoupper ($string);//Change All caps
Strtolower ($string);//Change All lowercase
Ucwords ($string);//capitalize the first letter of the word
The Strrpos () function finds
Some of the most commonly used PHP reflection functions Get_class Get_class_methods
1. Get_class? Returns the class name of the object
String Get_class ([object $obj])
Returns the name of the class to which the object instance obj belongs.
Mixed Call_user_func (callback $function [, Mixed $parameter [, mixed $ ...])
A PHP function is passed with a function name string. Any built-in or user-defined functions can be passed in addition to the language structure such as array (), Echo ()
H_encod = "gb2312";//Set character encoding (WAP page encoding) $H _WML-H_head ();//Set Header information $H_WML-H_nocah ();//No cache (whether cached) requires cache and does not need to write the row $h_wml H_card ("CD1", "Green Leaf");//Set Card
The basic idea of exception handling is that code is invoked to execute in the try code. If there is an error in the try code block, we can perform a handling of throwing exceptions. Some programming languages, such as Java, will automatically throw
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