Example of how php outputs XML files using functions
$ Conn = new PDO ("mysql: dbname = lamp; host = localhost", "root", "123456 ");
$ SQL = "select id, username, phone, *** from user ";
$ Pdo = $
A php class that calls the database
Class DataBase
{
Var $ pConnect = FALSE; // whether to use persistent connections
Var $ mHost; // database host
Var $ mDatabase;
Var $ db; //
Allows Kohana to use a third-party template engine
The Kohana view layer is simple. the variable data is placed in the $ _ data array. Therefore, by inheriting the Kohana_View class and overwriting some methods, you can easily use a
Function of using mcrypt for encryption and decryption in PHP
// Encrypt Function
Function mc_encrypt ($ encrypt, $ mc_key ){
$ Iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256
Configure database parameters in ZendFramework
Configure database parameters in Zend Framework
I created a zend framework project using zend studio 7.2.1.
That is to say, my framework was created by zend stduio7.2.1 to help
An elegant byte-related conversion formula
Function parsing
/**
* @ Desc convert to the number of nodes
* Pay attention to its case usage. Because break is not written, an elegant conversion formula can be
Method 1 of traversing the tree
Recursive depth-first algorithm
Define ('Ds', DIRECTORY_SEPARATOR );
Function rec_list_files ($ from = '.')
{
If (! Is_dir ($ from )){
Return array ();
}
$ Files
URI processing functions
I wrote this function myself, and the technology is not very good. Therefore, please advise me if there are any inappropriate ones.
Function modifyUri ($ param = '', $ value = ''){
2 // Obtain the URI
PHP relative path problems
PHP FastCgi in IIS Require path cache problems The require Series functions have the same relative paths.
/* PHP FastCgi problems in IIS
Require path cache problems
The require Series
MYSQL tips -- LAST_INSERT_ID
MYSQL tips -- LAST_INSERT_ID
Use PHP to call mysql. the built-in LAST_INSERT_ID () function may not be used by anyone. The most commonly used function is mysql_insert_id ();
In fact,
PHP null value judgment
Although empty and isset are both variable processing functions, they are used to determine whether the variables are configured, but they are different: empty also checks whether the variables are empty and zero.
Php judges Chinese and English characters (another one)
It seems that I remember a previous, was written by myself, today this is online, from: http://www.cnblogs.com/zcy_soft/archive/2010/12/13/1904791.html
/* There are a lot of
Phpmailer mail class library
Phpmailer mail class library
Header ('content-Type: text/html; charset = utf-8 ');
Require ("phpmailer/class. phpmailer. php ");
Error_reporting (E_ERROR );
Function
Php code for reading detailed information of a zip file
$ Zip = zip_open ("20101105.zip ");
If ($ zip ){
While ($ zip_entry = zip_read ($ zip )){
Echo "Name:". zip_entry_name ($ zip_entry )."";
Example of sending an email using the pear: Net_SMTP class
Require 'net/SMTP. php ';
$ Host = '1970. com'; // ip address or domain name of the smtp server
$ Username = 'arcow'; // username used to
: Php variable undefined and other error solutions: Set the error level in the project to error_reporting (E_ALL | E_STRICT); array variable undefined will also report an error, in fact, it is quite good, but sometimes this error does not need to be
: Use the one-step php list operation to assign values to a group of variables: for example: & lt ;? Phplist ($ a, $ B) explode (, microtime (); echo $ a. ------. $ B ;? & Gt; result: 0.60937700 ----- 1305625768 example:
List ($ a, $ B) = explode
Php lazy functions automatically add data. For more information, see. Php lazy functions automatically add data. For more information, see.
The code is as follows:
/** @ Automatically add a data function * @ $ table name * @ $ arr field Library
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