Is there a function like array_fill
, that lets me fill an array with the same string ("field_"), combined with an increasing $i variable like this:
private function fields() {
$result = [];
foreach(range(1,44) as $i) {
$result[] = "field_$i";
}
return $result;
}
I know there is a bunch of functions in php and I would love to have this in one line (if possible).