Example
Fill thearraywith the key value of the given specified key name:
Definition and usage
array_fill_keys()FunctionFills the array with the key value of the given specified key name.
Syntax
array_fill_keys(keys,value);
Parameters | Description |
keys | Required. Array whose values will be used to populate the array keys. |
value | Required. Specifies the key values used to populate the array. |
Technical Details
Return value: | Returns the populated array. |
PHP version: | 5.2+ |
Example:
The running results are as follows :
Array( [foo] => banana [5] => banana [10] => banana [bar] => banana )
The above is the detailed content of The function array_fill_keys() that fills the array with the key value of the specified key name given by php. For more information, please follow other related articles on the PHP Chinese website!