Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP array_fill_keys() Function

PHP array_fill_keys() Function

PHP Array ReferenceComplete PHP Array Reference Manual

Example

Fill an array with values using the specified keys:

Run Example »


Definition and Usage

The array_fill_keys() function fills an array with values using the specified keys.


Syntax

array_fill_keys(

keys,value

);

Parameters Description
keys Required. An array whose values will be used as the keys of the filled array.
value Required. Specifies the value used to fill the array.

Technical Details

Return Value: Returns the filled array.
PHP Version: 5.2+

PHP Array ReferenceComplete PHP Array Reference Manual