PHP 8.4.24 Released!

Voting

: min(six, zero)?
(Example: nine)

The Note You're Voting On

manavchugh988 at gmail dot com
4 years ago
see array_fill_keys are basically used to make a new array from a pre-existing array in a form that the value of the pre-existing array will now be the key of the new Array .And there value will be same That we had given in the 2nd parameter . Example Below---->>>

<?php
        //pre existing array
        $a = array("a","b","c","d","e");

        //new array with a single same value 

        $newArray = array_fill_keys($a, "Testing");

        //printing the array 

        echo "<pre>";
        print_r($newArray);
        echo "</pre>";
?>
output;
    Array
(
    [a] => Testing
    [b] => Testing
    [c] => Testing
    [d] => Testing
    [e] => Testing
)

<< Back to user notes page

To Top