Welcome To Snipplr


Everyone's Recent Snippets Tagged array



This function will sort an array of DOM elements in order of the DOM position. Useful when using calls such as $$("img.L,img.M") which doesn;t return a sorted element array. It uses prototype but you can replace the Prototype.Browser stuff with a...
0 2414 posted 18 years ago by kouphax
0 2158 posted 18 years ago by ianmonge
Repeatable Fisher Yates Array Shuffle based on given random string. If no seed is provided the current second will be used (not to use as a pure random shuffle... based on microseconds)
0 2363 posted 18 years ago by digdan
0 1972 posted 18 years ago by iTony
2 2100 posted 18 years ago by benphelps
1 2196 posted 18 years ago by cristiana
1 1812 posted 18 years ago by jamesming
1 1906 posted 18 years ago by wesbaker
1 1649 posted 18 years ago by zb3k
3 2946 posted 18 years ago by Anthony
4 2920 posted 18 years ago by Anthony
I have fixed and improved some code I found on the Internet
1 2094 posted 18 years ago by ozke
1 1750 posted 18 years ago by Meestercor
I have fixed and improved some code I found on the Internet
1 2275 posted 18 years ago by ozke
0 1747 posted 18 years ago by mattkenefick
This was taken out of a presentation by eZ systems on PHP Best Practices
0 2081 posted 18 years ago by luizlopes
1 2284 posted 18 years ago by lakedenman
1 2115 posted 18 years ago by rwitten
1 1905 posted 18 years ago by sherakama
ASP does not have a built in function to reverse or sort array like other languages. Find out how to do it.
1 2601 posted 18 years ago by neal_grosskopf
Useful for speeding up searches.
1 3333 posted 18 years ago by jarnaldich
This function can validate and parse UK postcode like SW1A 1AA in to formated array.
2 2729 posted 18 years ago by naz
/* ---===[ EXAMPLE ]===--- */ var TT = new AssociativeArray(); TT.add("k-1", "Value 1"); TT.add("k-2", "Value 2"); TT.add("k-3", "Value 3"); TT.add("k-4", "Value 4"); alert(TT.to_string());
1 1616 posted 18 years ago by vbert
/* --==[ EXAMPLE ]==-- var colors = new AArray(); colors.add("k01", {bk:"#fff",tk:"b",it:"hello"}); var oC = colors.get("k01"); var tT = ''; for(K in oC) tT += "[" + K + "]: " + oC[K] + "\n"; tT += "\n\n"; tT += oC.bk + "\n"; tT += oC...
1 2373 posted 18 years ago by vbert
Returns the cartesian product of the receiver and the arrays given as arguments.
1 2221 posted 18 years ago by ishikawa
Fallback Function for versions earlier then php5
0 1826 posted 18 years ago by razel