Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use array_keys() function php.?

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 126
    Comment on it

    What does array_keys() function in php.?
    The array_keys() function returns an array containing the keys.

    Syntax of array_keys() function:

    array_keys(array,value,strict)

    So, there are three main Parameter of array_keys().
    These are following:
    1-array(this is used for specifying an array)
    2-Value(this is used for specifying the value)
    3-strict( This is optional and used with the value parameter)

    You can take reference form below example to use of array_keys() function in php.

    <?php
    //here GetName is variable  of array
    $GetName=array("Surya"=>"ab10","Nancy"=>"bc20","Tom"=>"de30");
    //here call the array_keys() and print data
     print_r(array_keys($GetName));
    ?>
    

    Output of above code will be as following:-
    Array ( [0] => Surya [1] => Nancy [2] => Tom )

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: