Today, a netizen in the group sent a topic is not difficult, but may be wrong
Copy CodeThe code is as follows:
Echo
$a = = 1? ' One ':
$a = = 2? ' Both ':
$a = = 3? ' Three ':
$a = = 4? ' Foura ': ' Other ';
echo "\ n";
The output is:
The
So I
Think of the inheritance to solve, previously published a session class, this is much simpler, by logging on to set the level of users, $session->get_status () return
A value of 0 indicates that the current user is not a blogger and therefore
Copy CodeThe code is as follows:
/**
* Single case mode
*
* Ensure that a class has only one instance and provides a global access point to access it
*
*/
Class Singleton
{
static private $_instance = NULL;
Private Function __construct
Copy CodeThe code is as follows:
/**
* Builder mode
*
* Separate the construction of a complex object from its representation, using the same build process to create different representations
*/
Class Product
{
public $_type = null;
public $_size =
svnpeer.php
Copy CodeThe code is as follows:
/**
*
* This class for execute the external program of SVN
*
* @auth Seven Yang
*
*/
Class Svnpeer
{
/**
* List directory entries in the repository
*
* @param string a specific project
Find a workaround on the Web:
Copy CodeThe code is as follows:
/* Handling Json_encode Chinese garbled */
$data = Array (' Game ' = ' ice Fire country ', ' name ' = ' thorn spirit ', ' country ' + ' frost State ', ' level ' = 45);
echo Json_encode
In the PHP language, the header () function is useful, especially when using Ajax, and he will help you solve some unexpected problems. Here are some detailed explanations of the header. Hope to be helpful to Phper
Copy CodeThe code is as follows:
This makes it easy and quick, but it tends to be sensitive when it comes to storing information, which can be targeted, such as bank accounts, credit card transactions, or archival records. This requires security measures when writing code to reduce
An agent refers to a role acting on behalf of another role, as in life, a wine manufacturer who is not directly selling wine to retail customers is through an agent to complete his sales business. and customers, do not need to drink red wine
The principle of XOR algorithm
From the main method of encryption, the transposition method is too simple, especially for the case of less data, it is easy to guess the plaintext by ciphertext, and the substitution method is an effective and simple
The template engine based on regular expression substitution can easily meet the limit of the maximum backtracking/recursion of regular expressions.
Lazy matching is not scary, normally the template is not enough, often does not exceed the limit,
The code is as follows
Copy CodeThe code is as follows:
$dir = ' D:\Program files\resource\application\skin\png\\ ';//pay attention to the path here, the last to add two \, the first one means to turn, but this is easy to encounter other specific
Look at the code:
Copy CodeThe code is as follows:
New Document
$string 1 = "I am a phper";
$string 2 = "This website is the home of the script";
Print_r (Str_split ($string 1));
echo "
";
Print_r
Jpgraph Introduction
Prior to the use of PHP mapping must master the complex abstract drawing function, or with some Web-based download style chart, pie chart class to achieve. There is no unified chart class to implement the rapid development
On the top page of the page, add
Date_default_timezone_set (PRC); /* Transfer time to Beijing time, php5 default to Greenwich Mean Time */
Date ()
A: "AM" or "PM"
A: "AM" or "PM"
D: A few days, two digits, if insufficient 0; from "01" to "31"
D: Day
Krsort () Definition and usageThe Krsort () function reverses the array by key, preserving the original key for the set value.
The Second optional parameter contains an additional sort flag.
Returns TRUE if successful, otherwise FALSE is returned.
In general we will write this:
Copy CodeThe code is as follows:
if ($_get[' time ']==null)
{
$time = time ();
}
Else
{
$time = $_get[' time '];
}
Echo $time;
If get has time this value is brought into the variable.
?>
If only simple judgment,
Sort () Definition and usageThe sort () function sorts the values of the given array in ascending order.
Note: This function assigns the new key name to the cells in the array. The original key name is deleted.
Returns TRUE if 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