Checking searching presence of an element inside an array

We can check or search the presence of an element inside an array by using in_array function in PHP. The script below will create an array with some element and then will apply the in_array function to check the presence of an element.

This function will return True or False based on the presence of the search element.


echo "Cris is there inside the array";}
else{ echo "Cris is not there ";}
array_search()Search for value inside Array. Returns the key if found, FALSE otherwise
array_keys()Array of keys for matching values, FALSE otherwise
array_key_exists()Search for key inside Array. True if found, FALSE otherwise

Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net



    nice site

    Post your comments , suggestion , error , requirements etc here .

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 All rights reserved worldwide Privacy Policy Disclaimer