Welcome To Snipplr


Everyone's Recent Snippets Tagged array



1 2 3 4 5 6 7 ... 13
Quick and easy javascript in_array function. It's not perfect, but if you need something quick, this is it.
1 118 posted 9 years ago by cornellsteven
0 173 posted 9 years ago by lajlev
This function automates the creation of the <OPTION>s of a <SELECT> element. It's ideal for your AJAX apps when you create display elements using Javascript It accepts to different kind of arrays: An array of key:values… var arrDirs = {...
0 133 posted 9 years ago by nomada
Useful when used with the google map directions function http://snipplr.com/view/15530/php-create-google-map-directions-link/
0 181 posted 9 years ago by iloveitaly
This method is easy to write, but not very efficient, as you can imagine.
2 327 posted 9 years ago by dyteq
Summary ======= A useful function for masking arrays. Very useful if you have a function or method that takes arguments in an array, and you would like to force that array to have a specific structure. Its also great for setting defaults due to...
0 235 posted 9 years ago by RobertWHurst
How to sort array in smarty template? >> Create sort modifier file and save it in smarty / plugins with modifier.sortby.php name use this modifier in smarty template like... {foreach item=item key=key from=$users|@sortby:"firstname"} {$item.i...
0 318 posted 9 years ago by aashvi
Prints an array (recursive) as PHP code (can be pasted into a php file and it will work). Note: This function can process arrays with integers/strings/sub-arrays. It is impossible to process resources (they have a state), and while it is possible...
1 162 posted 9 years ago by BrunoDeBarros
Does the same as `System.arraycopy(source, copyFrom ,target, copyTo, length)` but without worrying about invalid input. Example for an array of characters.
0 91 posted 9 years ago by Voil
Simple function that filters out any duplicate items in an array.
7 339 posted 9 years ago by Nettuts
Sometimes you need special array functions, not build in AS3. Special ArrayUtils class with some static methods can help us :)
5 162 posted 9 years ago by burnandbass
/*Coded by Alessio Delmonti - www.tecnocrazia.com */
1 115 posted 10 years ago by Mosaic
/*Coded by Alessio Delmonti - www.tecnocrazia.com*/
0 102 posted 10 years ago by Mosaic
0 108 posted 10 years ago by ppofuk
Write function "get_min_range" which returns the subscript of the smallest value in a portion of an array containing type int values. It has three arguments: an array, the first subscript in the subarray, and the last subscript in the subarray.
0 92 posted 10 years ago by itsaboutcode
1067: Implicit coercion of a value of type __AS3__.vec:Vector.<com.Gallery:VOItem> to an unrelated type __AS3__.vec:Vector.
0 117 posted 10 years ago by alptugan
vLarger - Larger array vSmaller - Smaller array
2 147 posted 10 years ago by jaredyeo
5 162 posted 10 years ago by jaredyeo
1 97 posted 10 years ago by ionutzp
Simple function to store an array in a cookie. Uses JSON. To pull data out of cookie use 'json_decode()'. It can then be looped etc.
1 420 posted 10 years ago by liamchapman
0 146 posted 10 years ago by zreedeecom
0 271 posted 10 years ago by zoranmk
Drupal snippet
0 201 posted 10 years ago by apro2000
A rough "it works" way to delete elements from an array given the array of indices to delete. A new array is created by copying over the remaining elements. Any suggestions on how to make this more efficient appreciated :)
0 167 posted 10 years ago by studioevoque
Nothing special. First snippet. :)
0 171 posted 10 years ago by embrace
1 2 3 4 5 6 7 ... 13