PHP: in_array – Search Array

center

Apply the in_array function to check the presence of an element.
in_array function will return True or False based on the presence of the search element.

 <?php
    $code = array("CSS", "PHP", "Javascript", "MySql");
    if (in_array("PHP", $code)) {
       echo "PHP found";
    } else {
       echo "PHP is not there ";
    }
    if (in_array("css", $os)) {
       echo "css?";
    }
?>

Thank You!

  • Share/Bookmark



Post a Comment

You must be logged in to post a comment.