Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to find the particular value in an array in PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 112
    Comment on it

    Hello Readers ,

    Most of the time in our application we need this function called in_array .

    This function searches an array for a specific value.

    Example :

    <?php
    $people = array("Peter", "Joe", "Glenn", "Cleveland");
    
    if (in_array("Glenn", $people))
       {
       echo "Match found";
       }
    else
       {
       echo "Match not found";
       }
    ?>
    

    Output :

     Match found 
    

 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: