1. Go to this page and download the library: Download greeny/array-class library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$array = ArrayClass::from([]);
// you can count elements natively
count($array);
// iterate over elements
foreach ($array as $key => $value) {
// do stuff
}
// and even modify some of them!
$array[1] = 4;
$array[2] = $array[3] * isset($array[4]) ? $array[4] : 4;
unset($array[5]);
// import class
use greeny\ArrayClass\ArrayClass; // yes, I know, weird namespace
$array = new ArrayClass; // initializes from empty array
$array = new ArrayClass($original); // initializes from original array
$array = ArrayClass::from($original); // same as before, good for chaining methods immidiatelly, like below:
$array = ArrayClass::from($original)->filter()->shuffle(); // etc etc
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.