Welcome To Snipplr
Everyone's Recent Snippets Tagged array
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
I found this awesome class by [email protected] and can't help but share it.
1
990
posted 14 years ago by chrisaiv
A utility function to preserve an array in a session. Adding the newest element to the beginning of the array and popping out the last one. Useful for displaying for instance; your last searches option in your website.
1
977
posted 14 years ago by Heroftime
Searches all array elements for a given substring. Returns an array of found key=>value pairs or false if not found.
0
788
posted 14 years ago by lancemonotone
Simple function that sorts a bi-dimensional array by one of it keys.
1
1057
posted 14 years ago by AlejoLuc
C#
Generic list wrapper returns a smaller strongly typed sub-list which modifies the parent-list when changed (without events)
A class which wraps a parent list containing mixed object types, to provide smaller strongly typed sub-lists of objects. These sub-lists can be modified, which then modifies the parent list concurrently (without events being triggered). Supports the...
0
845
posted 14 years ago by bryanlyman
This is a class/demonstration for creating dynamic properties and storing them in an array
1
665
posted 14 years ago by mpcircuitry
Consider the following piece of code which compares two arrays to find which elements exist in outerArray that do not exist in innerArray:
0
801
posted 14 years ago by quan
Before:
`
Array
(
[0] => Array
(
[total_sessions] => 24
[study_type_id] => 1
)
[1] => Array
(
[total_sessions] => 24
[study_type_id] => 2
)...
0
673
posted 14 years ago by iloveitaly
This creates an array of various linux shell names, loops through the array and ouputs a file called shell_locations.txt showing where the shells are located on the linux system.
0
998
posted 14 years ago by webonomic
A script I used for quickly load a file (see line 3) and then make a table which had linenumbers on each line. You may want to add a +1 when its generating the table...
0
812
posted 15 years ago by Knarf
For more information, see php.net, under usort
It works with dates
Replace 0 for the array's key you want to sort. For example, if you have a start_date array key you would like to compare, then you would replace 0 for start_date.
If you wan...
0
938
posted 15 years ago by leonelsantos
This can be tested using the following piece of code
var a = [1, 2, 3, 4, 5];
alert(a.size());
0
719
posted 15 years ago by arunpjohny
This function is add 'each' function to the javascript Array object.
1
609
posted 15 years ago by arunpjohny
Create log.txt in scripts directory and set permissions to 0666 before use.
0
757
posted 15 years ago by Nek