Class mysql{
Privete static $instance;//Save Instance
The constructor is declared private, preventing the object from being created directly
Privete function __construct () {
Instantiation of
}
A singleton method
/**
* Class Name: Pdopage
* Author: Xie Tao shishengsoft@gmail.com
* Description: Inherited from PDO class, added automatic paging function, similar to the automatic paging function of MS ADO component.
*/bbs.it-home.org
----
Picture clipping, zooming function
$filepath picture Path, $percent zoom percentage
function imagepress ($filepath, $percent = ' 0.5 ') {
Type of picture
Header (' Content-type:image/jpeg ');
Get a new picture size
Before this site published "excellent Programmer's 10 habits" and "programmers need to have the basic skills", that is what we need to learn and develop. Here, we mainly discuss the characteristics of 10 bad PHP programmers, mainly need to let us to
PHP How to create a multilevel directory, PHP to create a multi-level directory of instance code, as well as PHP recursive directory creation Method example, through an example of PHP operation file directory specific methods.
First, PHP to
PHP array to remove the null value of the small function, PHP recursive function to delete the array of values are empty elements, together learning.
Code:/** * Method Library-array removal null value * @param string $num value * @return
$conn = @mysql_connect ("localhost", "username", "password") or Die ("Cannot connect to MySQL Server");
Copy CodeDescription: A close connection must be displayed using the connection2, Mysql_pconnect ()-Establish database connection
/**
* Captchaimage ()-Create a captcha picture of distorted characters
* $session the variable name of the session required to create the _name string verification code picture
* $width int to verify the width of the picture, default 1
PHP UTF8 Half garbled problem
Web site appeared a bug, the page header garbled, and other places normal, the head is include a head.php, the entire page is UTF8, But I opened the head.php to see, it is to use the UTF8 way to save, the
/*
* 1. Get the file name of the path
* String basename (string path[,string suffix])
* 2, get the directory of the Path
* String DirName (string path)
* 3, learn more about the path information
* Array PathInfo (string
Solution for call to undefined function curl_init
Environment: Windowsphp+apacheError: Call to undefined function curl_initSolution: First, open the php.ini, find "Extension=php_curl.dll", and then remove the previous ";" Note, restart
Put on the SAE and generate the graph online.Http://tuzhong.sinaapp.com
Require (' db.php ');
if ($_server[' request_method '] = = ' POST ') {
$stor = new Saestorage ();
Make sure you have
As mentioned above, many times we need to know the user's browser type
/**
* Determine browser name and version
*/
function Get_user_browser ()
{
if (Empty ($_server[' http_user_agent '))
{
Return ';
nonsense don't say, on resources: New Linux video tutorial: Http://pan.baidu.com/s/1c01r15Y HTML5 video tutorial: Http://yun.baidu.com/s/1jGIJLum Java, Android Video tutorial: http://yun.baidu.com/s/1dDvOH37 Cocos2d-x Video tutorial:
What are common PHP functions, some examples of PHP custom functions, callback functions, variable functions and recursive functions, and the use of PHP global variables and local variables, static functions, and so on.
PHP function
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