|
General Details
|
|
PHP (Hypertext Preprocess...
|
|
Posted 108 Days Ago
|
|
682 Views
|
|
Received 3 Ratings
|
|
PHP - Collections Class
Description
A replica of the Collection class in VB6
Technical
Supports the following methods (see examples at the bottom of source code for more info)
add(item, before, after); //before and after are optional, to bypass before use null & before and after are optional
count(key);
item(key);
remove(key);
Source Code
Comments
| Please login to post comments. |
|
|
Isn't PHP arrays generally vectors anyway? As in dynamically grow/shrink as needed. So PHP does support vector (arrays).
Kind regards,
Scott
|
|
|
Well, in PHP, that's what it comes down to... an array. PHP is not very strict and doesn't have many options for such a class.
If PHP only supported Vectored Arrays (actually, they are called Vector's, not arrays, but had to add array just in case someone didn't know)
Very well done though.
|
|
|
Thats not what collections are. Don't think of them as arrays or you will get confused.
Kind regards,
Scott
|
|
|
Should make it so you can use $add ( arrray ( 1,2,3,4 ) );
Just put in the add function to test if it's an array or not.. if it is an array loop until count array and add to function, if you understand what i mean. I've just woken up :)
|
More "PHP (Hypertext Preprocessor)" Source Codes By This Author
Recently Posted "PHP (Hypertext Preprocessor)" Source Codes
Recently Rated "PHP (Hypertext Preprocessor)" Source Codes
|