With array_fill
, I want to repeat and merge array.
Example, when I execute :
$array = array_fill(0, 2, array_merge(
['hello'],
['by']
));
var_dump($array);
I have this result :
array(2) {
[0]=>
array(2) {
[0]=>
string(5) "hello"
[1]=>
string(2) "by"
}
[1]=>
array(2) {
[0]=>
string(5) "hello"
[1]=>
string(2) "by"
}
}
But I want this result :
array(4) {
[0]=>
string(5) "hello"
[1]=>
string(2) "by"
[2]=>
string(5) "hello"
[3]=>
string(2) "by"
}