Welcome To Snipplr


Everyone's Recent Snippets Tagged array



Search recursive in array
1 187 posted 7 years ago by bigmichiel
This snippet is a lambda function (anonymous function) to create an xml from an array. It uses recursiveness.
1 214 posted 7 years ago by abrahamsustaita
This table is based on the ISO 2 letter (Alpha-2 code, ISO 639-1) and 3 letter (Alpha-3 code, ISO 639-2) Standard Codes for the Representation of Names of Languages.
0 267 posted 7 years ago by rwt
Checks if two given arrays equal each other as php doesn't have a built in function for this.
0 155 posted 7 years ago by MaxHudson
Outputs the content of a multi-dimensional array in the $GLOBALS['lv']
0 209 posted 7 years ago by steho
Use it similar to in_array function of PHP.
0 238 posted 8 years ago by kosinix
Header lista_polje.h, implementacija liste pomoću polja
0 109 posted 8 years ago by markoaleric
javascript arrays up and down
2 144 posted 8 years ago by kutyadog
Function to convert a one dimensional array to two dimensional with option to specify how many columns. Returns two dimensional array on success or false on fail.
0 381 posted 8 years ago by kosinix
Sum all elements of a bidimensional or multi-dimensional array with an assigned key
0 199 posted 8 years ago by eortiz
Lambda expression to convert an array.
0 222 posted 8 years ago by rengber
Original by dvdrtrgn
0 253 posted 8 years ago by guilhermehn
I use this primarily for debugging purposes. This simply takes an array and creates an expandable item that prints the array out in a \<pre\> wrapping, making it easy to read. Very basic snippet.
0 229 posted 8 years ago by ringo380
Sort multidimesional array using qsort
0 244 posted 8 years ago by barigazy
Search recursively some value in array with the key name
0 240 posted 8 years ago by MonsterDev
The closest to a generic List in javascript. When calling constructor - new List(Module) - add model in constructor parameter
0 175 posted 8 years ago by mikkeldamm
Using array_map() on multidimensional arrays
0 418 posted 8 years ago by pruntrut
The following shoud do it. pass the array, index is what element you want to sort on (in your case use 3). Then you can sort asc or desc, and weather you want to use natural sorting (the way a human would sort, 2 before 10) and lastly case sensitive...
0 197 posted 8 years ago by pruntrut
sort a multidimensional array by field
0 204 posted 8 years ago by akt
sort a multidimensional array by field
0 199 posted 8 years ago by akt
A nice way to do sorting of a key on a multi-dimensional array - DavidG
0 232 posted 8 years ago by satie83
In this purely constructed example, we create anonymous function and use call to invoke it on every object in an array. The main purpose of the anonymous function here is to add a print function to every object, which is able to print the right index...
0 202 posted 8 years ago by hellowouter
Clever usage of apply allows you to use built-ins functions for some tasks that otherwise probably would have been written by looping over the array values. As an example here we are going to use Math.max/Math.min to find out the maximum/minimum valu...
0 257 posted 8 years ago by hellowouter
If you want to use this in a class, change the last line to: ` return array_map(array($this, __FUNCTION__), $object ); `
0 158 posted 8 years ago by jgomez
Converts a php object to an associative array
1 1085 posted 8 years ago by satie83
Removes duplicating elements from Array, containing only objects of Point class
0 163 posted 8 years ago by romech
Writing an PHP array in a javascript file with json_encode.
0 246 posted 8 years ago by Narayon
Easily breaks a string into an array of words. *If your string has special characters such as latin, add those characters to the r var. Just like var r:RegExp = /[^\wçàáâãèéêìíîòóôõùúûüÀÁÇÂÃÈÉÊÌÍÎÒÓÔÕÙÚÛÜ¡]+/...
0 299 posted 8 years ago by izaiasdotcom
Sorts an array of objects using the native sortOn method
0 286 posted 8 years ago by Narayon
This method shuffles an array. This is the optimum implementation for such an algorithm - O(n).
0 192 posted 8 years ago by fixpq