, , ,

List of 20 Array functions in PHP with example

Posted by

Array Functions In PHP
  • array_change_key_case — This function Changes the case of all keys in an array.
  • array_chunk — It will split an array into chunks.
  • array_column — It returns the values from a single column in the input array.
  • array_combine —It creates an array by using one array for keys and another for its values.
  • array_count_values —It counts all the values of an array.
  • array_diff_assoc —It computes the difference of arrays with an additional index check.
  • array_diff_key —It computes the difference of arrays using keys for comparison
  • array_diff_uassoc —It computes the difference of arrays with an additional index check which is performed by a user-supplied callback function.
  • array_diff_ukey —It computes the difference of arrays using a callback function on the keys for comparison.
  • array_diff —It computes the difference of arrays.
  • array_fill_keys —This function will fill an array with values, specifying keys.
  • array_fill —It will fill an array with values.
  • array_filter —It will filters elements of an array using a callback function.
  • array_flip —This function will exchange all keys with their associated values in an array.
  • array_intersect_assoc —It will compute the intersection of arrays with an additional index check.
  • array_intersect_key —This function will compute the intersection of arrays using keys for comparison.
  • array_intersect_uassoc — It computes the intersection of arrays with an additional index check, and compares indexes by a callback function.
  • array_intersect_ukey —It computes the intersection of arrays using a callback function on the keys for comparison.
  • array_intersect —It computes the intersection of arrays.
  • array_key_exists —This function will checks if the given key or index exists in the array.
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x