Php5 and mysql5 web development technology details 1-php Array

Source: Internet
Author: User

1. Create immediately or extract range () to quickly create an array of specified element values. For example, range () range (, 2) range ('A', 'z') shuffle () disrupts the array order. array_rand () specifies the number of elements to be extracted. For example, extract an element and return a variable. Extract multiple elements and return an index array. 2. sort arrays. sort () in ASCII order. sort priorities: numbers, letters, and Chinese characters () sort by array relevance ksort () sort by array index value in ascending order krsort () sort by array index value in descending order 3. Count function array_count_values to count the number of times an array element appears array_sum (array $) array Element summation count () sizeof () 4. array Processing array_combine (array a1, array a2) array merging a1 as the key name, a2 as the key value array_unique (array $) array_flip () Key-value pairs 5. Search for array_key_exists ($ key_str, $ array) in_array ($ value_str, $ array, [bool]) 6. Move the current () next () prev () end () 7. Obtain the associated array key () 8. Access the array key and key value array_keys () array_values () 9. Determine the array type (to be supplemented) is_array () 10. display content and structure print_r () var_dump () var_export () 11. insert and remove elements unset () array_shift () insert array_splice () array_push () array_pop () 12 at the top of array_unshift (), export the content as the variable extract () 13, and export other list () each () for () foreach ()

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.