In PHP, arrays are divided into two types: Numerical index arrays and associated arrays.
The numeric index array is the same as the array in C language. The subscript is 0, 1, 2...
The subscript of the correlated array may be of any type, which is
Below
Code:
Copy codeThe Code is as follows:
The usage is like this.Setmycookie ('name'); in this way, a cookie named name is set under the domain name.PHP is easier to read.Copy codeThe Code is as follows: $ STR = $ _ cookie ('name'); // The
There are many PHP File Upload classes on the Internet, and file upload processing is a special feature of PHP (at least this is shown in the manual as a feature of PHP, I personally think PHP has better array functions.) PHP learners all know how
CopyCode The Code is as follows: $ Num = 1220.01;
Echo fmoney ($ num); // result: 1,220.21
Echo umoney ($ num );
// Result: One thousand and two hundred twenty dollars and twenty-one cents only
Echo umoney ($ num, "RMB ");
// Result: One thousand
In_array
(PHP 4, PHP 5)
In_array-check whether a value exists in the array
DescriptionCopyCodeThe Code is as follows: bool in_array (mixed $ needle, array $ haystack [, bool $ strict])
Search for needle in haystack. If yes, true is returned.
1, year-month-day
Echo date ('Y-m-J ');
2007-02-6
Echo date ('Y-n-J ');07-2-6
Uppercase y indicates four digits of the year, while lowercase y indicates two digits of the year;Lowercase M indicates the number of the month (with the leading
This is the default Implementation Method to extend the select of Yibing.
CopyCode The Code is as follows:
Value = "1"> residential
Value = "2"> Office
Value = "3"> business Room
Value = "4"> plant
Value = "5"> repository
Value = "6">
Directly
Code
Copy code The Code is as follows: // Date_default_timezone_set ("Asia/Shanghai ");
/*
Function create_siteinfo
Done: website information table
Author: www.5dkx.com
Date: 2010-3-30
Table Structure:
Title website name
Keyword website
Eaccelerator. shm_size = "32"
The amount of shared memory that eaccelerator can use (in megabytes ). "0" refers to the default value of the operating system. the default value is "0 ". it can be adjusted according to the actual situation of the
CopyCode The Code is as follows:/* Get the image News list */
Function getpicnews ($ number = 5 ){
Require_once 'include/content_class.php ';
$ Content = new content ();
$ SQL = 'select contentid as ID, title, PIC, typeid from 'cms _ content' Where
Above: 1. The following questions should be written on the grass paper provided to you in addition to programming tasks. Paper is a precious Earth resource, please save your use. When a programming task has a corresponding environment, it will
CopyCodeThe Code is as follows: //-delete an article
ArticleMultiple Static pages generated
//-The generated article is named 5.html 5_2.html 5_3.html
/*------------------*/
Function delstatichtml ($ article_id)
{
Global $ dB;
$ SQL = "select
EOF is a very important concept, almost every mainstream
Programming Language The corresponding built-in functions are provided to verify whether the parser has reached the file EOF. In PHP, this function is feof (). The feof () function is used to
CopyCode The Code is as follows: /*
* Generate xml file for Ubuntu automatic switch Wallpaper
*/
// Image directory
$ Dir = '/home/Yuxing/background ';
$ Hd = opendir ($ DIR) or die ('can not open dir ');$ Files = array ();While ($ file =
CopyCode The Code is as follows: /*
Function used to determine whether a string exists
*/
Function strexists ($ haystack, $ needle ){
Return! (Strpos ($ haystack, $ needle) ===false); // note the following: "==="
}
/*
Test
*/
$ Mystring = 'abc ';
$
The member table structure we want to use
CopyCode The Code is as follows: Create Table if not exists 'net _ 111cnnet '(
'Id' int (11) not null auto_increment,
'Username' varchar (32) default null,
'Add _ time' int (11) default null,
'Email
Copy codeThe Code is as follows :/*------------------*/
//-Obtain the list data of an unlimited category
/*------------------*/
Function get_sort ($ parent_id = 0, $ n =-1)
{
Global $ db;
Static $ sort_list = array ();
$ SQL = "SELECT * FROM".
Developers often find it useful to use this data structure in PHP to sort values or array elements. PHP provides some sorting functions suitable for multiple arrays. These functions allow you to arrange elements within the array, and allow you to re-
Some simple video playing functions are often encountered in web development, but the video formats are different and can be dynamically increased. Therefore, we must save the video to Data, now let's take a look at the simple section I wrote.
Php
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