Zhanhailiang Date: 2014-10-081. Install pretty JSON using Package ManagerSlightly.2. Common shortcut key descriptionCtrl+alt+j formatting JSON strings ctrl+alt+m compressing JSON stringsThese shortcuts can also be configured by modifying shortcut
The example in this article describes a method that PHP implements to sort a key in a two-dimensional array. Share to everyone for your reference, specific as follows:
/** * Sorting Query result set * @access public * @param array $list Query
Array ([key =>] value, [key =>] value, [key =>] value, [key =>] value)//key can be integer or string//value can be Is any value
Array_change_key_case--Returns an array of string keys that are all lowercase or uppercase
Array_chunk--Splits an array
Collection
The JDK class library provides a Java collection in which all Java collection classes are located in the Java.util package. Unlike Java arrays, basic type data cannot be stored in a Java collection, and only references to objects are
The following articles go from this blog:
Http://blog.sina.com.cn/s/blog_63c66eb60100slyc.html
The questions that this blog can solve for you are as follows: What is the natural sort collections.sort () and Arrays.sort () the similarities and
One, Set
set: Focus on the unique nature of the system set to know whether something is close to the collection and does not store duplicate elements
Used to store elements that are unordered (not necessarily the same in the order in which they
Select
Select returns the order of records
Zhongxing Communication Chongqing Institute Rempo Wu Yuhong
Keywords: SELECT, order, optimize, backup, scan, index
Article Summary:
When we execute the SELECT statement, the order of the records
Essay Classification-Javajava Collection Framework Summary (5)--map Interface Usage Summary: Map is used to save the data (Key-vlaue) with the mapping relationship. The key of map does not allow repetition, that is, any two key of the same map
basic functions of array manipulationthe key name and value of the arrayArray_values ($arr); Get the value of an arrayArray_keys ($arr); Get the key name of the arrayArray_flip ($arr); The values in the array are interchanged with the key names (if
PHP Array functionPHP: Indicates the earliest version of PHP that supports this function.
function
Description
PHP
Array ()
Creates an array.
3
Array_change_key_case ()
Returns an
A List l may be sorted as follows:
Collections.sort (l);
If the list is composed of String elements, it is sorted alphabetically by dictionary; If it is made up of Date elements, it will be sorted in chronological order. How does Java know how to
Set Set1. OverviewCollectionList collection: Sequential (consistent in order of storage and extraction), repeatable.Set set: unordered (storage order and check out inconsistencies), unique2.HashSet(1). Overview: HashSet does not guarantee the set
The previous article describes the general knowledge of set sets. The Set collection contains three more important implementation classes: HashSet, TreeSet, and Enumset. This article will focus on these three classes. I. Introduction of HashSet
PHP Array function
function
Description
PHP
Array ()
Creates an array.
3
Array_change_key_case ()
Returns an array whose keys are uppercase or lowercase.
4
TreeSet supports two sorts of sorting methods: natural sorting and custom sorting. TreeSet default to natural sorting.
1, Natural sorting
TreeSet invokes the CompareTo (Object obj) method of the collection element to compare the size relationships
TreeSet
Conditions
Same type
Design to sort
Comparable is natural (you can modify the case of a class)
Comparator is custom (in the case of a class cannot be modified) higher priority
Instructions for use:
Generally used is the natural sort, but
/**
* Rewind the array's internal pointer back to a
* @param array & $arr
* @return Mixed returns the value of the previous cell and returns FALSE when there are no more units
* If the array contains an empty cell, or if the value of the cell is 0,
One, Custom function
The custom function is our own defined function, in PHP the custom function format is as follows:
function Funname (arg1, arg2, Arg3 ...) {
Todo
return values;
}
Output results:
Here's another
In actual development, more or less will encounter array sorting problem, in addition to the conventional write simple sorting algorithm, PHP also provides a built-in array sorting function, this time to share the key: Uasort Use user-defined
array_change_key_case-returns an array with a string key that is all lowercase or uppercase
array_chunk-to split an array into multiple
Array_combine-creates an array with the value of one array as its key name and the value of the other array as
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.