PHP array_fill_keys() FunctionThe array_fill_keys( ) function is a built-in function in PHP. It is used to create a new array filled with the given keys and value provided as an array to the function. It was introduced in PHP version 5.2. SyntaxParameter
Return TypeIt returns the filled array. EXAMPLE 1Output: Array ( [a] => javatpoint [b] => javatpoint [c] => javatpoint [d] => javatpoint ) EXAMPLE 2Output: Array ( [1] => 1000 [2] => 1000 [3] => 1000 [4] => 1000 [5] => 1000 [apple] => 1000 ) EXAMPLE 3Output: Array ( [Delhi] => lndia [Haryana] => lndia [Bihar] => lndia [Gujarat] => lndia ) EXAMPLE 4Output: Array ( [Delhi] => Array ( [0] => india [1] => javatpoint ) [Haryana] => Array ( [0] => india [1] => javatpoint ) [Bihar] => Array ( [0] => india [1] => javatpoint ) [Gujarat] => Array ( [0] => india [1] => javatpoint ) ) Next TopicPhp-array-filter-function |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India