Php date function example: get the last day of the month
/**
* Date-get the last day of the current month
* @ Return int
*/
Public function get_lastday (){
If ($ this-> month = 2 ){
$ Lastday =
Phpmemcached cache code instance
Class MemcacheModel {
Private $ mc = null;
/**
* Constructor is used to add a server and create a memcahced object.
*/
Function _ construct (){
$ Params =
Php static variables _ php static variables and global static variables examples
Function test ()
{
Static $ var = 5; // static $ var = 1 + 1; an error is returned.
$ Var ++;
Echo $ var .'';
}
Analysis of methods for generating non-repeated random numbers using php
Function get_randoms ($ min, $ max, $ num ){
$ Count = 0;
$ Res = array ();
While ($ count
$ Res [] = mt_random ($ min, $
An example of php multi-image upload code
Usage: save the above code with the file name more_upload_file.class.php. you can include this file when using it.
Share a PHP class for multi-image upload. this class of File annotation is
Php method for drawing a positive cosine curve on an image
/**
* Method for drawing a positive cosine curve on an image
* Edit: bbs.it-home.org
*/
Define ("MAX_WIDTH_PIXEL", 600 );
Define
Sample code for connecting php to the oracle database
If ($ conn = OCILogon ("kai", "fjelite", "linux "))
{Echo "SUCCESS! Connected to database/n ";
}
Else
{Echo "Failed:-(cocould not connect to
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..
Several methods for php to determine the file type to Upload
/**
Desc: determine the type of the uploaded file
Link: bbs.it-home.org
Date:
*/
$ Array = array ('jpg ', 'GIF', 'PNG',
Php user-defined function recursively replaces the content in the array
/**
Desc: recursively replaces array content
Link: bbs.it-home.org
Date: 2013/2/22
*/
Function arrContentReplact
Usage of fgetcsv and compatibility issues in windows and linux
$ File = fopen ("contacts.csv", "r ");
Print_r (fgetcsv ($ file ));
Fclose ($ file );
?>
CSV file: George, John, Thomas, USA James,
An example of using a temporary table to query data
$ Sql3 = "create temporary table atmp_table (uid int (11), dnum int (20) not null )";
Mysql_query ($ sql3 );
$ Sql3 = "INSERT into atmp_table (uid, dnum)
Use functions to delete and copy files. check whether magic reference is enabled.
The deletion and copying of files through functions has shown whether magic reference is enabled.
/**
I still have a hard time
*
Several minor mistakes that php beginners can easily make
This article lists several minor mistakes that php beginners may make for your reference. 1. the header already sent error usually occurs when you use the HEADER. it may be caused by
A small mistake that is easy to ignore. Have you ever made it?
Modify the foreach array value
/**
* Note the differences in foreach values
*/
$ Arr = array (1, 2, 4 );
Echo "foreach
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