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 510 posted 13 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 667 posted 13 years ago by iloveitaly
This method is easy to write, but not very efficient, as you can imagine.
2 1108 posted 13 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 927 posted 13 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 1963 posted 13 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 689 posted 13 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 407 posted 13 years ago by Voil
Simple function that filters out any duplicate items in an array.
7 1359 posted 13 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 665 posted 13 years ago by burnandbass
/*Coded by Alessio Delmonti - www.tecnocrazia.com */
1 516 posted 13 years ago by Mosaic
/*Coded by Alessio Delmonti - www.tecnocrazia.com*/
0 471 posted 13 years ago by Mosaic
0 472 posted 13 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 373 posted 13 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 527 posted 13 years ago by alptugan
vLarger - Larger array vSmaller - Smaller array
2 616 posted 13 years ago by jaredyeo
5 627 posted 13 years ago by jaredyeo
1 447 posted 13 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 1193 posted 13 years ago by liamchapman
0 543 posted 13 years ago by zreedeecom
0 924 posted 13 years ago by zoranmk
Drupal snippet
0 688 posted 13 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 647 posted 13 years ago by studioevoque
Nothing special. First snippet. :)
0 682 posted 13 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 574 posted 13 years ago by alexstone
1 2 3 4 5 6 7 ... 13