Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use array_search() Function in php

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 145
    Comment on it

    what is array search ?

    Array search returns the corresponding key if search is successful and Searches the array for a given value.

    You can take reference form below example.

    <?php
    //firstly create a array 
    $employeName=array("1"=>"Jorden","2"=>"Roy","3"=>"Mac");
    // here $employeName is a variable in which store all array data
    
    echo array&#95;search("Roy",$employeName);
    // here call the array&#95;search() for find the value in array
    
    ?>
    

    Output will come 2

    here 2 is corresponding key because search is successful.

 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: