PHP array

PHP array are useful to store multiple data using a single variable. Using index of the PHP array we can access the stored variables. Indexes to an array element can either a number or a string. An array is a list variables. Each item in an array is commonly known as element of the array and can be accessed directly via its index.
Creating an ArrayHow to create and assign keys
Displaying elementsListing all elements of the array
array_diff We can generate a resultant third array by differentiating two arrays
array_count_values calculate the frequency of occurrence of elements inside a array
array_size() How many elements are present inside the array? We can find out by count or sizeof() function.
array_max() Maximum minimum value present inside array
array_keys() Returns Array of keys of a main array
array_pushadd elements to an existing array
array_merge add one array to other by using array_merge
array_sum Total value or sum of the elements present inside an array
in_arrayCheck the presence of an element inside an array. Returns True of False
array_rand Randomly collecting elements of an array
array_unique set of unique value from an array
Breaking string We can split a string and create a array by using all words.
Session array create a session array and carry same data across the pages.
Deleting elements Delete elements by using key or value
Sorting Sorting all elements of an array by sort command
usort sort the elements by using user defined function.
array_map apply native functions or user defined function to each elements
Filtering elements Creating new array with filter ( callback ) function
array_walk() Passing user defined function to each element of an array
Multidimensional ArrayCreating and displaying elements of Multidimensional array
is_array To check the variable is array or not
Array checkbox Getting checkbox value using array
http_build_query generate query string using elements to pass through URL

Be the first to post comment on this article :


Post Comment This is for short comments only. Use the forum for more discussions.

HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us
©2000-2015 All rights reserved worldwide Privacy Policy Disclaimer