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 498 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 644 posted 13 years ago by iloveitaly
This method is easy to write, but not very efficient, as you can imagine.
2 1080 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 896 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 1908 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 663 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 395 posted 13 years ago by Voil
Simple function that filters out any duplicate items in an array.
7 1313 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 635 posted 13 years ago by burnandbass
/*Coded by Alessio Delmonti - www.tecnocrazia.com */
1 502 posted 13 years ago by Mosaic
/*Coded by Alessio Delmonti - www.tecnocrazia.com*/
0 460 posted 13 years ago by Mosaic
0 457 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 365 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 507 posted 13 years ago by alptugan
vLarger - Larger array vSmaller - Smaller array
2 592 posted 13 years ago by jaredyeo
5 597 posted 13 years ago by jaredyeo
1 433 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 1171 posted 13 years ago by liamchapman
0 525 posted 13 years ago by zreedeecom
0 900 posted 13 years ago by zoranmk
Drupal snippet
0 670 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 621 posted 13 years ago by studioevoque
Nothing special. First snippet. :)
0 656 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 555 posted 13 years ago by alexstone
1 2 3 4 5 6 7 ... 13