Class Foo {
function Name_none_static () {
echo "My name is". Get_class (). "";
echo "My name is". Get_class ($this). "";
}
}
Class internal Call
$bar = new Foo ();
/home/jerry/public/php-5.4.0/ext/pcntl
Copy CodeExplanation: The int pcntl_fork (void) pcntl_fork () function creates a child process that is different from its parent process only PID (process number) and ppid (parent process number). On
if (...) {
Const FOO = ' BAR '; Invalid
}
But
if (...) {
Define (' FOO ', ' BAR '); Valid
}
Copy Code4, const uses a common constant name, define can use the expression as the name. For example:
if ($something) {
Include ("Somefile");
}
Copy CodeHowever, regardless of the $something value, the following code will include the file somefile into the file:
if ($something) {
This article introduces the following, the PHP array of pointer operations related content, is commonly used PHP array functions of the Operation Guide, the need for friends, refer to it.PHP array operation function: Array (key=value); Create arrays/
This article introduces a method for removing duplicates of PHP arrays, including the deduplication of one-dimensional arrays and the de-weight of two-dimensional arrays. Refer to a friend who needs it.First, take a look at the removal of
/*
Copyright Dominic Sayers
(dominic_sayers@hotmail.com)
(http://www.dominicsayers.com)
This source file was subject to the Common public Attribution License Version 1.0 (CPAL) License.
The license terms is available through
This article describes a class of PHP operations Access database, with the need for a friend reference.The code is as follows:
GetList ("Select TOP 5 * from ' Result ' WHERE ' Resultno ' num_rows ("Upda Te ' Conner ' set ' connerip ' = ' 222.35.
Date.timezone = PRC
Copy CodeTo set the time zone in your code, you can:
Date_default_timezone_set (' Asia/shanghai ');
Date_default_timezone_set (' asia/chongqing ');
Date_default_timezone_set (' PRC '); PRC for
/**
* Get all directories and files included in the input directory
* Returned as an associative array
* edit:bbs.it-home.org
*/
function Deepscandir ($dir)
{
$FILEARR = Array ();
$DIRARR = Array ();
$dir
[Session]
; Handler used to store/retrieve data.
Session.save_handler = files; This is the way of the session, the default files can be used to indicate the storage.
Copy CodeThere are two different ways to do this, user and
This article to share some of the PHP code used to verify the email address, the need for friends, refer to learn it. For example, in the user registration program, we often want to check the e-mail address entered is correct, you can use the
Copy CodeAttention:
tag, the file upload must be specified as Multipart/form-data. Also, note the hidden value of the form option max_file_size in file upload.html, which limits the size of the uploaded file by setting its value. The value
This article introduces, with PHP implementation of the file download some code, the need for friends may wish to refer to.The 1,php download function implements the file download function with the header () function and the ReadFile () function.
/**
* MySQL read/write separation
* edit:bbs.it-home.org
*/
Class db
{
Public function __construct ($sql)
{
$chestr = Strtolower (Trim ($sql));
If the SQL statement has a SELECT keyword, connect to the
This article to share a sample PHP verification code implementation codes, a simple verification code function, with a verification code, useful to the friend can take reference.This section of code to implement a simple PHP verification code, the
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