You can reduce memory usage on your script by destroying them as soon as you´re done with them.

Fonctions sur les tableaux; Change language: Edit Report a Bug.

sizeof (PHP 4, PHP 5, PHP 7) sizeof — Alias de count() Description. In PHP it is just an alias for the true function count(). array_diff_ukey — Calcule la différence entre deux tableaux en utilisant une fonction de rappel sur les clés pour comparaison array_diff — Calcule la différence entre des tableaux array_fill_keys — Remplit un tableau avec des valeurs, en spécifiant les clés Should be called like so: I was looking for an array aggregation function here and ended up writing this one. Lately, dealing with databases, I've been finding myself needing to know if one array, $a, is a proper subset of $b. If you need to flattern two-dismensional array with single values assoc subarrays, you could use this function: A simple trick that can help you to guess what diff/intersect or sort function does by name. Detects object recursion and allows setting a maximum depth. Function to pretty print arrays and objects. While PHP has well over three-score array functions, array_rotate is strangely missing as of PHP 5.3. I was able to get over a few megabytes of memory by simply destroying some variables I didn´t use anymore. I need to take an element from the Array and change its position within the Array by moving the rest of the elements as required.// Move element in position 5 to position 3, leaving array as it was... ;) /*to change an index without rewriting the whole table and leave at the same place. Big arrays use a lot of memory possibly resulting in memory limit errors. Based on arraytostring and u_print_r from the print_r function notes. Searching online offered several solutions, but the ones I found have defects such as inefficiently looping through the array or ignoring keys. While there are a lot of array functions in the PHP libs, there also seem to be a lot of rudimentary ones missing. Short function for making a recursive array copy while cloning objects on the way. Here is a function to find out the maximum depth of a multidimensional array. Cette fonction est un alias de : count().