Changes

PHP Arrays

336 bytes added, 19:02, 1 June 2007
Sorting an Array
sort($colorArray, SORT_STRING);
</pre>
 
== Sorting Associative Arrays ==
 
Associative arrays can be sorted in two ways, either by key or by value. To sort by key use ''ksort'' and ''krsort'' (reverse sort). To sort by value use the ''asort'' and ''arsort'' functions. The syntax and options for these functions are as outlined for the ''sort'' and ''rsort'' functions above.