Thursday, August 6, 2009

A Sneak Peek of Array Functions

A Sneak Peek of Array Functions

PHP Array Introduction

The array functions allow a user to manipulate arrays. PHP has the ability to support both simple and multi-dimensional arrays. One can also discover specific functions for populating arrays from database queries.

Installation

The array functions are part and parcel of the PHP core. There is no installation required to use these functions.

PHP Array Functions

· Array: The main function is to create an array.

· Array Change Key Case: It allows you to return an array with all the keys in the lowercase as well as the uppercase.

· Array Chunk: This splits the arrays into chunks of arrays.

· Array Combine: It can create an array by using one array for keys and another for its values

· Array Count Values: It helps to return an array with the number of occurrences for each value.

· Array diff: It compares various array values, and returns the difference

· Array_diff_assoc: It can compares array keys and values, and returns the differences

· Array diff key: This compares array keys, and returns the differences

· Array diff uassoc: It is able to compare the various array keys and values with a specific user made function check. It can also return the differences.

· Array diff ukey: It can compare array keys, with an additional user-made function check, and returns the differences

· Array fill: It fills an array with different values

· Array filter: It filters elements of an array using a user-made function

· Array flip: It can exchange all keys with their associated values in an array

· Array Intersect: It can compare the array of different values while also returning the matches.

25in; LINE-HEIGHT: normal; mso-add-space: auto; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1">· Array Intersect Assoc: It has the capacity to compare the array keys and values and also returns it to the matches.

· Array Intersect Key: It compares array keys, and returns the matches.

· Array map: It sends each value of an array to a user-made function, which returns new values.

· Array merge: It merges one or more arrays into one single array

· Array merge recursive: It is able to merges one or more arrays into one array.

· Array multisort: Array Multisort is able to sort the multidimensional arrays.

· Array pad: It is able to insert a specified number of items, with a particular value, to an array.

· Array pop: Deletes the previous element of an array.

· Array product: It can calculate the product of the values in an array.
PHP Array functions are thus numerous. It helps the user in manifold ways to make the PHP development easier and faster. One most obvious is the array

No comments:

Post a Comment