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

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 276
    Comment on it

    Why use array_flip() function in php.?

    The array_flip() function mainly used for exchanging all keys with their associated values in an array.

    Syntax of array_flip() function:

    array_flip(array)

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

    <?php
    //$City is a array_name
    $City=array("a"=>"Addor","b"=>"Anjar","c"=>"Bargarh","d"=>"Chatra");
    //call the array_flip() function
    $Getresult=array_flip($City);
    //print for $Getresult for output
    print_r($Getresult);
    
    ?>
    

    output will come:
    Array ( [Addor] => a [Anjar] => b [Bargarh] => c [Chatra] => d )

 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: