Function for generating random numbers using PHP
Function randomkeys ($ length)
{
$ Pattern = '1234567890abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLOMNOPQRSTUVWXYZ,./& l
T;> ?; #:@~ [] {}-_ = +) (* & ^
PHP is an efficient network programming language.
PHP is an efficient network programming language. it is a preferred language for Web programmers because of its flexible programming and fast running. A recent authoritative survey showed
Example of global php global variable
$ A = 1;
$ B = 2;
Function Sum ()
{
Global $ a, $ B; // declare it as a global variable
$ B = $ a + $ B;
}
Sum ();
Echo $
Php code for pagination of long articles
/**
* Author: wuniao heart
* Code for pagination of long articles
* Principle:
* Use an array to record every page of the article (p0, p1, p2..
Very useful php prevents SQL injection vulnerability filtering function code
// PHP full-site anti-injection program, which must be included in the public file require_once
// Determine the magic_quotes_gpc
Solutions to php Chinese garbled characters
[Mysql]
Default-character-set = utf8
[Mysqld]
Default-character-set = utf8
Default-storage-engine = MyISAM
Add the following under [mysqld:
Access modifiers in php oop
/*
The following two methods declare that the access permission works the same
*/
Function say (){};
Publilc function say (){};
When a class member is
Three methods for php page redirection
PHP page Jump 1. header () function
The header () function is a very simple method for page jump in PHP. The main function of the header () function is to output the HTTP header to the browser.
The header ()
How to obtain the browser and operating system information of the client using php
// Display the browser information of the visitor
Echo 'Browser: '. determinebrowser ($ Agent ).'';
// Display the
Common php curly brackets
$ A = 'flower ';
Echo "She has ed some $ ";
// Invalid; the letter s is regarded as a valid variable name component element, but the variable here is $
Echo "She has ed some $ {a} s";
Php Chinese string intercepting php Chinese string code
/**
@ Truncate a Chinese string for GB2312 encoding
@ Http://bbs.it-home.org
*/
Function FSubstr ($ title, $ start, $ len = "", $
Php replaces the code of the parameter variable in the URL
/**
* Set a parameter in the URL to a value.
* Link: bbs.it-home.org
* Date: 2013/2/27
*/
Function url_set_value ($ url,
Solve the problem of losing session value passing across pages in phpsession (text)
Solve the problem of missing session value passing across pages in php sessions. if you have encountered this problem, refer. Session running
DATE_FORMAT, FROM_UNIXTIME, UNIX_TIME
DATE_FORMAT (NOW (), '% B % d % Y % h: % I % p ')
DATE_FORMAT (NOW (), '% m-% d-% Y ')
DATE_FORMAT (NOW (), '% d % B % Y ')
DATE_FORMAT (NOW (), '% d % B % Y % T: % f ')
Summary of php connection to mssql
$ Conn = mssql_connect ("instance name or server IP address", "username", "password ");
// Test the connection
If ($ conn)
{
Echo "connection successful ";
}
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