Answer the question
In order to leave comments, you need to log in
How to add values to an array using the Arr helper?
Initial data
$array = [];
$one = 1;
$two = 2;
if (true) {
$array = Arr::add($array,'0',$one);
}
if (true) {
$array = Arr::add($array,'1',$two);
}
dd([$one, $two]);
// или с индексом 0
dd([$two]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question