📖
How to use?
The easiest way to try out ArrayUtils is using the poggit. Poggit automatically merges virions, it is better to use this feature.
As with all classes, must import ArrayUtils into your php file.
use kim\present\utils\arrays\ArrayUtils;
There are 4 ways to create ArrayUtils.
In the most basic way, it's just created through the constructor.$arr = new ArrayUtils([1,2,3,4,5]);echo $arr->join(", "); //1, 2, 3, 4, 5
$arr = ArrayUtils::from([1,2,3,4,5]);echo $arr->join(", "); //1, 2, 3, 4, 5
$arr = ArrayUtils::of(1,2,3,4,5);echo $arr->join(", "); //1, 2, 3, 4, 5
All methods can be called statically with the suffixFrom
echo ArrayUtils::joinFrom([1,2,3,4,5], ", "); //1, 2, 3, 4, 5
Last modified 2yr ago