PHP Tutorial Array Util

Update

  1. Assign null as the function name in array_map in PHP
  2. Change all letters of the array values to uppercase with array_map in PHP
  3. Change value for each an array element with reference in PHP
  4. Delete the last element of an array in PHP
  5. Fill an array with values in PHP
  6. Join array elements with a string in PHP
  7. Randomize the order of the elements in the array in PHP
  8. Separate the array elements with different characters in PHP
  9. Sum an array with array_reduce in PHP
  1. Check if a number is in an array in PHP
  2. Checks if a value exists in an array in PHP
  3. Search an array for a value and return its key in PHP
  4. Search an array with duplicate value for the value 5 and return its key in PHP
  5. Search for a value in an array and output some text in PHP

Compare

  1. Compare the items numerically and sort string array in descending order in PHP
  2. Compare the values of three arrays, and return the differences in PHP
  3. Compare the values of two arrays, and return the differences in PHP
  4. Compare values of three arrays with user function to compare values, and return matches in PHP
  5. Compare values of three arrays with user function to compare values, return differences in PHP
  6. Compare values of two arrays with user-defined function to compare values and return the matches in PHP
  7. Compare values of two arrays with user function to compare values and return differences in PHP

Count

  1. Count all the values of an array in PHP
  2. Count the array recursively in PHP

Create

  1. Create an array containing a range of elements from " 0 " to " 5 " in PHP
  2. Create an array using one array as keys and another as values in PHP

Get

  1. Find the differences between array_replace() and array_replace_recursive() in PHP
  2. Get an array of random keys in PHP
  3. Get column of last names from a recordset in PHP
  4. Get column of last names from a recordset, indexed by the " id " column in PHP
  5. Get returned array after removing elements from an array and replace it with new elements in PHP
  6. Get the current element key and value, and move the internal pointer forward in PHP
  7. Get the number of elements in an array in PHP
  8. Move cursor in array and output in PHP
  9. Return 5 elements and insert value " blue " to the new elements in array in PHP
  10. Return a random key from an array in PHP
  11. Return an array of elements from " 0 " to " 50 " and increment by 10 in PHP
  12. Return an array of random string keys in PHP
  13. Return the element key from the current internal pointer position in PHP
  14. Run each array element in a user-defined function in PHP
  15. Send each value in array to a function, and return an array with the new values in PHP
  16. Use letters - return an array of elements from " a " to " d " in PHP
  17. Using a user function to change the values of an array with array_map in PHP
  18. Using only one array parameter with integer keys in array_merge in PHP

Insert

  1. Insert duplicate value in front of an array with negative size parameter in PHP
  2. Insert the element to an array and get the return value in PHP
  3. Insert the element to an array and use numeric keys in PHP
  4. Insert the element to an array in PHP
  5. Insert two values to the end of an array in PHP

Merge

  1. Merge two arrays and sort them as numbers, in descending order in PHP
  2. Merge two arrays into one array in PHP
  3. Merge two arrays into one array recursively in PHP

Output

  1. Output the value of the current and next element in an array, reset the array pointer to first element in PHP
  2. Output the value of the current and the next element in the array in PHP
  3. Output the value of the current element in an array in PHP
  4. Output the value of the current, next and previous element in the array in PHP

Pass

  1. Pass each array element in a user-defined function in PHP
  2. Pass each array element in a user-defined function with a parameter in PHP
  3. Pass in two arrays into array_map in PHP
  4. Pass values in array to a user-defined function and return a string with array_reduce in PHP
  5. Pass values in array to user-defined function and return a string with array_reduce with initial parameter in PHP

Remove

  1. Remove duplicate values from an array in PHP
  2. Remove elements from an array and replace it with new elements in PHP
  3. Remove elements from an array and replace it with new elements with the length parameter set to 0 in PHP
  4. Remove the first element from an array, and return the value of the removed element in PHP

Replace

  1. Replace the values of the first array ($a1) with the values from the second array ($a2) in PHP
  2. Replace the values of the first array with the values from the second array recursively in PHP
  3. Replace three arrays - the last array ($a3) will overwrite the previous ones ($a1 and $a2) in PHP
  4. Replace values among three array recursively using array_replace_recursive in PHP

Reverse

  1. Reverse an array and preserve the original array in PHP
  2. Reverse an array in PHP

Slice

  1. Slice With both string and integer keys in PHP
  2. Slice from the end in PHP
  3. Slice start from the second array element, and return only two elements and preserve the keys in PHP
  4. Slice start from the second array element, and return only two elements in PHP
  5. Slice start from the third array element, and return the rest of the elements in array in PHP

Sort

  1. Sort an array by using a " natural order " algorithm. The values keep their original keys in PHP
  2. Sort an array in PHP
  3. Sort an array in ascending order in PHP
  4. Sort array in descending order in PHP
  5. Sort the elements of numbers array in descending numerical order in PHP
  6. Sort the elements of string array in descending alphabetical order in PHP
  7. Sort the elements of the $a array using a user-defined comparison function in PHP
  8. Sort the elements of the $arr array by keys using a user-defined comparison function in PHP
  9. Sort the elements of the $arr array by values using a user-defined comparison function in PHP
  10. Sort the elements of the $myValue array in ascending alphabetical order in PHP
  11. Sort the elements of the $numbers array in ascending numerical order in PHP
  12. Sort two arrays with two identical values in PHP

Split

  1. Split an array into chunks of two and preserve the original keys in PHP
  2. Split an array into chunks of two in PHP

Sum

  1. Sum all the values in array in PHP




















Home »
  PHP Tutorial »
    Data Types »




Array
Array Associative
Array Util
ArrayObject
Data Types
Date
Date Format
DateTime
Number
String
String Escape
String Filter
String HTML
String Type
Timezone