PHP array_fill() 함수
예시
값으로 배열 채우기:
<?php
$a1=array_fill(3,4,"blue");
print_r($a1);
?>
정의 및 사용
array_fill() 함수는 배열을 값으로 채웁니다.
통사론
array_fill(index, number, value)
매개변수 값
Parameter | Description |
---|---|
index | Required. The first index of the returned array |
number | Required. Specifies the number of elements to insert |
value | Required. Specifies the value to use for filling the array |
기술적 세부 사항
반환 값: | 채워진 배열을 반환 |
---|---|
PHP 버전: | 4.2+ |
❮ PHP 배열 참조