Walkthrough of a PHP Array
This article mainly explains the For,foreach,list,each,key, the pointer operation correlation function, the array_flip, the array_reverse,array_walks and so on function's logarithmic group's traversal
1.for Looping
Process processing functions
1. Process Start functionFunction name EvalCall Syntax eval (string)The commentary considers a string as a Perl statement execution.When executed correctly, the system variable $@ is an empty string, and if there is an
PhpArray Sorting
The elements in the array can be sorted in descending or ascending order, in alphabetical or numerical terms.
PHP-Array sorting functionIn this chapter, we will introduce the following PHP array sorting functions:
Array sorting: Elements in an array can be sorted in ascending or descending order in alphabetical or numeric sequence.commonly used PHP array sorting functionsort ()-sort the array in ascending orderRsort ()-Sort in descending pairsAsort ()-Sort
Parsing json in PHP is mainly used to Json_encode and Json_decode two PHP JSON functions, more convenient than PHP parsing XML, the following detailed introduction of the use of PHP json.
JSON Basics Introduction
JSON (JavaScript Object notation)
Dictionary, do you still use this thing now? With the development of the network, fewer people are used. Many people are accustomed to searching on the internet, not only the web version, but also the mobile version of a variety of dictionaries. I
For JSON objects, you can refer to Wikipedia (Http://zh.wikipedia.org/zh-cn/JSON) and the official website (http://www.json.org/json-zh.html).
We often say that JavaScript native supports JSON, because we can think of JSON as a flexible application
In foreach, the number of circular query data is less, but the performance is relatively low, the better solution is to collect the ID, in a one-time query, but this caused the data structure is not we use PHP functions can be merged, today tested:
In foreach, the number of circular query data code is relatively small, but the performance is relatively low, the better solution is to collect the ID, use in a one-time query, but this raises the data structure is not our own function with PHP can
This article illustrates the implementation of the cyclic traversal of associative arrays by PHP. Share to everyone for your reference. The specific analysis is as follows:
PHP for similar
$age = Array ("Zhangshan" =>14, "Lisi" =>15, "Sharejs"
Loops query data in foreach with less code, but performance is low, and functions written using the following bytes can resolve In foreach, the number of circular query data is less, but the performance is relatively low, the better solution is
The following are from http://www.w3school.com.cn/php/Thanks to the learning platform provided by W3chool. Praise.PHP Learning:Fragments of 1.PHP....2. Three ways to annotate:2.1//...2.2 # ...2.3/* .......*/3. function, class, keyword is not
PHP link mysql common extension function, PHP link mysql
First, PHP connection database and basic operations
MySQL uses a ' client/server ' architecture. Using the MySQL extension function installed in PHP, and accessing the MySQL database server
The 1.PHP supports two arrays: an indexed array (indexed array) and an associative array (associative array), which uses a number as the key, which uses a string as the key.
2. Iterating through an indexed array
2.1 For Loop statement
2.2 While
Dictionary, do you still use this thing now? With the development of the network, the use of fewer people. Many people are accustomed to search on the Internet, not only the web version, but also has a mobile version of the various dictionaries. I
Reference/pointers in the 12th chapter PERL5by FlamephoenixI. INTRODUCTION of citationIi. use of referencesThird, use the backslash (\) operatorIv. References and ArraysV. Multidimensional arraysVi. references to sub-programsSub-Program templatesVii.
1 Find the character position function:
Strpos ($str, Search,[int]): Find the first position of search in $str starting with int;
Stripos ($str, search,[int]): function returns the position of the first occurrence of a string in another string. This
1. The php script can be placed anywhere in the document.The PHP script begins with .In PHP, all user-defined functions, classes, and keywords (such as if, else, Echo, and so on) are not case sensitive. All variables are case-sensitive.2.PHP
The 1.arsort () function sorts the associative array in descending order of key valuesArsort (array,sortingtype);
0 = sort_regular-default. Arrange each item in the usual order (standard ASCII, no change type)
1 = sort_numeric-Each item
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.