PHP array

Array in PHP
PHP array are useful to store multiple data using a single variable. Using index of the PHP array we can access the stored data. Indexes ( or Keys ) 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
array_change_key_case()Changing keys to upper case or lower case chars
array_chunk()Split an array into chunks
array_column()Displaying one column data of an array
array_combine()Creating array with Keys of one and values of another array
array_count_values calculate the frequency of occurrence of elements inside a array
Displaying elementsListing all elements of the array
array_diff We can generate a resultant third array by differentiating two arrays
array_diff_assoc Resultant third array by differentiating two arrays considering Keys
array_diff_uassoc Resultant third array by differentiating values and (keys through callback function)
array_diff_ukey Resultant third array by comparing keys through callback function
array_udiff Resultant third array by comparing values through callback function
array_diff_key We can generate a resultant third array by differentiating two arrays by considering keys only
array_fill_keysCreate array by filling keys and value
array_fillFilling an array with value
array_filter() Creating new array using filter ( callback ) function
array_intersect_assoc() Intersection of arrays considering keys and values
array_intersect() Intersection of arrays considering values only
array_intersect_key() Intersection of arrays considering keys only
array_intersect_uassoc() Intersection of arrays considering keys & values through callback function
array_intersect_ukey() Intersection of arrays considering keys through callback function
in_arrayCheck the presence of an element inside an array. Returns True of False
is_array To check the variable is array or not
array_size() How many elements are present inside the array? We can find out by count or sizeof() function.
array_keys() Returns Array of keys of a main array
array_key_exists() Search Key, returns TRUE if found, FALSE otherwise
array_key_first() Getting first key of the array ( >= PHP 7.3.0 )
array_key_last() Getting last key of the array ( >= PHP 7.3.0 )
array_pushadd elements to an existing array
array_max() Maximum minimum value present inside array
array_merge add one array to other by using array_merge
array_merge_recursive() Merge one or more arrays recursively
array_pop Removing last element of an array
array_rand Randomly collecting elements of an array
array_range Create array using a range with optional step value
array_search Returns the key if matching found, FALSE otherwise
array_shift Remove first element of an array
array_sum Total value or sum of the elements present inside an array
array_shuffle randomizes the order of the elements of 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.
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
array_unshift Adding element at beginning of an array
array_unique set of unique value from an array
unset Delete elements by using key or value
array_walk() Passing user defined function to each element of an array
Multidimensional ArrayCreating and displaying elements of Multidimensional array
Array checkbox Getting checkbox value using array
http_build_query generate query string using elements to pass through URL
Navigation of Internal Pointer or cursor of the Array
CurrentPresent Element of the array
NextNext Element of the array
PreviousPrevious Element of the array
endLast Element of the array
resetFirst Element of the array

Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here

    PHP video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 All rights reserved worldwide Privacy Policy Disclaimer