arrayutils
  • Home
  • 📖How to use?
    • âš¡Installation
  • 📖Methods
    • âš¡Static method
      • static from()
      • static of()
      • static mapToArray()
    • âš¡Generic method
      • join()
      • every()
      • some()
      • reduce()
        • reduceRight()
      • sum()
      • pop()
      • shift()
      • includes()
      • keyExists()
      • indexOf()
      • find()
        • findIndex()
      • first()
        • keyFirst()
      • last()
        • keyLast()
      • random()
        • keyRandom()
      • splice()
    • âš¡Chain method
      • chunk()
      • column()
      • combine()
      • concat()
        • concatSoft()
      • countValues()
      • diff()
        • diffAssoc()
        • diffKey()
      • fill()
        • fillKeys()
      • filter()
      • flat()
        • flatMap()
      • flip()
      • forEach()
      • intersect()
        • intersectAssoc()
        • intersectKey()
      • keys()
      • map()
        • mapAssoc()
        • mapKey()
      • pad()
      • push()
      • replace()
      • reverse()
      • slice()
      • sort()
        • sortKey()
      • unique()
      • unshift()
      • values()
  • 📖Suffixes
    • âš¡Suffix - From
    • âš¡Suffix - As
  • links
    • 📌Github repo
    • 📌Packagist project
    • 📌Poggit project
Powered by GitBook
On this page
  1. 📖Suffixes

Suffix - From

Suffixing "From" to the any methods can called statically.

Suffixing "From" to the any methods can called statically. It can be used by giving an iterable as the first argument.

$arr = ArrayUtils::reverseFrom([1,2,3,4,5]);

var_export((array) $arr);
//array (0 => 5, 1 => 4, 2 => 3, 3 => 2, 4 => 1
$arr = ArrayUtils::from([1,2,3,4,5])->reverse();

var_export((array) $arr);
//array (0 => 5, 1 => 4, 2 => 3, 3 => 2, 4 => 1
Previous📖SuffixesNextSuffix - As

Last updated 2 years ago

âš¡