Sie sind auf Seite 1von 2

PHP 5 Array Functions

Function
array()
array_chunk()
array_combine()
array_diff()
array_fill()
array_fill_keys()
array_intersect()
array_intersect_key()
array_key_exists()
array_keys()
array_merge()
array_merge_recursive()
array_pop()
array_product()
array_push()
array_rand()
array_replace()
array_replace_recursive()
array_reverse()
array_search()
array_shift()
array_slice()
array_splice()
array_sum()
array_unique()
array_values()
arsort()
asort()
count()
current()
next()
reset()
sort()

Description
Creates an array
Splits an array into chunks of arrays
Creates an array by using the elements from one "keys" array and one
"values" array
Compare arrays, and returns the differences (compare values only)
Fills an array with values
Fills an array with values, specifying keys
Compare arrays, and returns the matches (compare values only)
Compare arrays, and returns the matches (compare keys only)
Checks if the specified key exists in the array
Returns all the keys of an array
Merges one or more arrays into one array
Merges one or more arrays into one array recursively
Deletes the last element of an array
Calculates the product of the values in an array
Inserts one or more elements to the end of an array
Returns one or more random keys from an array
Replaces the values of the first array with the values from following
arrays
Replaces the values of the first array with the values from following
arrays recursively
Returns an array in the reverse order
Searches an array for a given value and returns the key
Removes the first element from an array, and returns the value of the
removed element
Returns selected parts of an array
Removes and replaces specified elements of an array
Returns the sum of the values in an array
Removes duplicate values from an array
Returns all the values of an array
Sorts an associative array in descending order, according to the value
Sorts an associative array in ascending order, according to the value
Returns the number of elements in an array
Returns the current element in an array
Advance the internal array pointer of an array
Sets the internal pointer of an array to its first element
Sorts an indexed array in ascending order

PHP 5 String Functions


The PHP string functions are part of the PHP core. No installation is required to use these
functions.

Function
str_ireplace()
str_pad()
str_repeat()
str_replace()
str_split()
strcmp()
stristr()
strlen()
strpbrk()
strpos()
strrchr()
strrev()
strripos()
strrpos()
strspn()
strstr()
strtok()
strtolower()
strtoupper()
substr()
substr_count()
substr_replace()
trim()

Description
Replaces some characters in a string (case-insensitive)
Pads a string to a new length
Repeats a string a specified number of times
Replaces some characters in a string (case-sensitive)
Splits a string into an array
Compares two strings (case-sensitive)
Finds the first occurrence of a string inside another string (caseinsensitive)
Returns the length of a string
Searches a string for any of a set of characters
Returns the position of the first occurrence of a string inside another
string (case-sensitive)
Finds the last occurrence of a string inside another string
Reverses a string
Finds the position of the last occurrence of a string inside another
string (case-insensitive)
Finds the position of the last occurrence of a string inside another
string (case-sensitive)
Returns the number of characters found in a string that contains only
characters from a specified charlist
Finds the first occurrence of a string inside another string (casesensitive)
Splits a string into smaller strings
Converts a string to lowercase letters
Converts a string to uppercase letters
Returns a part of a string
Counts the number of times a substring occurs in a string
Replaces a part of a string with another string
Removes whitespace or other characters from both sides of a string

Das könnte Ihnen auch gefallen