Welcome To Snipplr


Everyone's Recent Snippets Tagged array



1 2 3 4 5 6 7 ... 13
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 389 posted 11 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 503 posted 11 years ago by iloveitaly
This method is easy to write, but not very efficient, as you can imagine.
2 799 posted 11 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 701 posted 11 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 1300 posted 11 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 482 posted 11 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 277 posted 11 years ago by Voil
Simple function that filters out any duplicate items in an array.
7 962 posted 11 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 466 posted 12 years ago by burnandbass
/*Coded by Alessio Delmonti - www.tecnocrazia.com */
1 379 posted 12 years ago by Mosaic
/*Coded by Alessio Delmonti - www.tecnocrazia.com*/
0 358 posted 12 years ago by Mosaic
0 339 posted 12 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 279 posted 12 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 357 posted 12 years ago by alptugan
vLarger - Larger array vSmaller - Smaller array
2 431 posted 12 years ago by jaredyeo
5 444 posted 12 years ago by jaredyeo
1 331 posted 12 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 925 posted 12 years ago by liamchapman
0 400 posted 12 years ago by zreedeecom
0 720 posted 12 years ago by zoranmk
Drupal snippet
0 506 posted 12 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 477 posted 12 years ago by studioevoque
Nothing special. First snippet. :)
0 486 posted 12 years ago by embrace
Used to make a Google Pie Chart, with optional labels and size from an array, using the array keys as the labels and the values for the data.
0 405 posted 12 years ago by alexstone
1 2 3 4 5 6 7 ... 13