Welcome To Snipplr
Everyone's Recent Snippets Tagged array
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
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
658
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
845
posted 13 years ago by iloveitaly
This method is easy to write, but not very efficient, as you can imagine.
2
1340
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
1119
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
2404
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
873
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
558
posted 13 years ago by Voil
Simple function that filters out any duplicate items in an array.
7
1600
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
831
posted 13 years ago by burnandbass
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
482
posted 14 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
658
posted 14 years ago by alptugan
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
1370
posted 14 years ago by liamchapman
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
816
posted 14 years ago by studioevoque
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
733
posted 14 years ago by alexstone