Add one or more elements to the beginning of an array.

array:prepend(ARRAY $array, $values_to_prepend)

$array = [2,3,4,5]
$value_to_prepend = 1
array:prepend($array, $value_to_prepend)
#=> [
#=>     1,
#=>     2,
#=>     3,
#=>     4,
#=>     5
#=> ]

Copyright ©2013-2022 SunSed®. All rights reserved.