First, the basic knowledge
This chapter briefly describes the internal mechanisms of some Zend engines, which are closely related to extensions, and can help us write more efficient PHP code.
1.1 The storage of PHP variables
1.1.1 Zval
Chart Library
The following class library allows you to create complex diagrams and pictures with minimal complexity. Of course, they require the support of the GD library.
Pchart-a library that can create a chart.
Libchart-This is also a
Copy CodeThe code is as follows:
/**
* Adapter Mode
*
* Convert a class's interface into another interface that the customer wants, using classes that are inherently incompatible to work with and can work together
*/
This is the original
The first type of notation:$content =str_replace ("\ n", "", $content);
Echo $content;
The second way:Str_replace ("\ r \ n", "", $str);
The third type of notation:$content =preg_replace ("/\s/", "", $content);
Echo $content;
Report:
First of
I conceived it myself, and the fact that the program solves the problem is an offset. First look at the series:: 1, 1, 2, 3, 5, 8, 13, 21, 34 the next number of series is the sum of the first 2 numbers, and so on.
Program processing, is actually a
Copy CodeThe code is as follows:
/**
* Interpreter Example
*
* @create_date: 2010-01-04
*/
Class Expression
{
function Interpreter ($STR)
{
return $str;
}
}
Class Expressionnum extends Expression
{
function Interpreter ($STR)
{
Switch ($STR)
{
Case
Here's the online
Copy CodeThe code is as follows:
Class Arraytoxml
{
/**
* The main function for converting to an XML document.
* Pass in a multi dimensional array and this recrusively loops through and builds up an XML document.
*
* @param array $
Demand:
1 The code on SVN has a set of local (editor UltraEdit), a set on the development machine (CentOS), need local code modification to upload to the development machine
2 is not modified and used directly on the development machine because
1. Super Simple page Cache
If your project is not based on a CMS system or framework, creating a simple caching system will be very real. The following code is simple, but it can solve a problem for small sites.
Copy CodeThe code is as
Or borrow an example from the previous article:
PHP code
Copy CodeThe code is as follows:
Example 1
function Test_global () {
Global $var 1, $var 2;
$var 2 =& $var 1;
}
function Test_globals () {
$GLOBALS [' Var3 '] =& $GLOBALS [' var1 '];
}
$var
First, Introduction
PHP is a powerful but fairly easy-to-learn server-side scripting language that even inexperienced programmers can use to create complex, dynamic Web sites. However, it often has many difficulties in achieving the secrecy and
Commonly used time functions:
1.time (); Gets the total number of seconds from 1970/1/1 00:00:00 to now
2.mktime (); Set time
3.date (); Detailed information about the time of acquisition
Representative String
Description
Main features: Using DOM classes to read XML files in PHP
Design Knowledge Points:
1, XML node loop read
2, using Iconv () function to achieve the code conversion, to prevent Chinese garbled
Holiday.xml files are as follows
Copy CodeThe code is as
PHP Comment Tags
@access
Scope of Use: Class,function,var,define,module
The tag is used to indicate access rights for the keyword: private, public, or proteced
@author
Specify the author
@copyright
Scope of Use:
Today a client's server is frequently written:
mm.php
The contents are:
Copy CodeThe code is as follows:
Finally find the first behavior in a file in the following code:
Copy CodeThe code is as follows:
Fputs (fopen (Base64_decode ("BW0UCGHW")
The function we want to use is Scandir, which is to list the files and directories in the specified path, just like Dir.
> A more powerful Glob () function that returns a file name or directory that matches the specified pattern in the form of an
PHP version mainly divided into three branches: PHP4/PHP5/PHP6
Among them, PHP4 is too old, the poor support for OO has basically been eliminated, it is not detailed.
And PHP6 because there is no application on the production line, but also
Step One: Build the environment
1, first check your PHP extension directory if there is php_gettext.dll this file, if not, this will require you
Download one or copy it from somewhere else and put it in the PHP extensions directory.
2, open php.ini,
Naming conventionsΘ files are named with the. class.php suffix, using the Hump method, and capitalized, such as Pay.class.php;
The Θ class name and directory _ file name are identical. For example: The Directory of class name Zend_autoloader is zend/
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