Summary of common PHP arrays and string functions

Source: Internet
Author: User
Tags array sort
This article mainly share with you the PHP common array and string function Summary, hope to help everyone.

Common String Functions:

Remove string leading and trailing spaces and special characters trim ()//Intercept string substr (), MB_SUBSTR ()//Find the location of the first occurrence of the specified string in the target string Strpos ()// Finds the last occurrence of the specified string in the target string Strrpos ()//replacement string Str_replace () Substr_replace ()//Calculate string length strlen ()//Escape and restore the string  (', ', \, NULL) addslashes () stripslashes ()//repeating string str_repeat ()//scrambled String str_shuffle ()//split string explode () array common functions//create array ()// Creates an array within the specified range ()//checks if there is a value in the array In_array ()//detects if the variable is an array is_array ()//The number of elements in the array count ()//gets some or all of the key names in the array Array_keys ()/ Gets all the values in the array array_values ()//computes all the values in the array and array_sum ()//searches for the given value's key name Array_search ()//randomly fetches one or more cells from the array array_rand ()//array sort (      do not keep index]asort ()     [keep index]//scrambled array shuffle ()//split fractional group Array_chunk ()//merge array array_merge ()//press element into the end of the array (into the stack) Array_push ( )
Related Article

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.