Special operators and functions commonly used in php
Special Operator numbers and functions commonly used in php (including annotation symbols, common symbol escaping, operator numbers, value assignment operators, bit operations, logical
Example of returning an array with an infinitely recursive php class
/**
* Returns an array of recursive infinitely classified values.
* Link: bbs.it-home.org
* Date: 2013/2/21
*/
$
Example of recursive summation of php arrays
/**
Desc: recursive summation of arrays
Link: bbs.it-home.org
Date: 2013/2/22
*/
Function arraySumRecursive ($ array)
{
$ Total =
Php uses array_unique to determine whether the same value exists in the array
$ Input = array ("a" => "green", "red", "B" => "green", "blue", "red ");
$ Result = array_unique ($ input );
Print_r ($ result );
Learn how to use constants in php
In php, a constant is a value that cannot be modified during program execution. When processing a value that never needs to be modified, you can consider setting it as a constant.In php, a constant is a
Php array function in_array () to find whether the specified value exists in the array
$ People = array ("Peter", "Joe", "Glenn", "Cleveland ");
If (in_array ("Glenn", $ people ))
{
Echo "Match
Example of php variable type determination
$ S = "this is a string ";
$ I = 9;
$ Arr = array (2, 4, 6 );
Is_string ($ s); // returns TRUE, indicating that $ s is a string variable.
Is_string ($ I);
Drupal-7.12 create node type
Drupal site development
Function examplenode_install (){
// Updates the database cache of node types
Node_types_rebuild ();
$ Types = node_type_get_types ();
// Add the
Differences between global and $ GLOBALS [] for php
$ Var1 = 1;
Function test (){
Unset ($ GLOBALS ['var1']);
}
Test ();
Echo $ var1;
?>
Because $ var1 is deleted, nothing is
Code to generate a month array from the start month to the end month in a time period
/**
* Generates an array of months from the start month to the end month of a time period.
* @ Param unknown_type
Who can get the lottery only after reprinting?
I saw a person on his website. after entering the lottery activity and selecting the lucky draw method, I could generate a QR code and scan the mobile phone. You can draw a lottery only after
In-depth analysis of Java,. NET, and Web application features
In this survey, developers engaged in java development accounted for 51.27% of the total survey objects, so this also makes the survey of java language usage more accurate.The
You cannot miss a php paging class (mysql)
/*
Mysql_pager.class.php
Three parameters: mysql_query () result, url variable page, the number of records per page you want
*/
Class mysql_pager {
New Tricks-php paging Sample code
/*
Database test, a test table, unique field Id, used for testing
@ Link http://bbs.it-home.org
*/
$ Conn = mysql_connect ("localhost", "root ","");
$ Maxnum
Php code that calculates the maximum number of characters that appear in strings with unknown length
$ Arr = str_split ($ str );
$ Arr = array_count_values ($ arr );
Arsort ($ arr );
Print_r ($ arr );
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