how to check an element exists in array

 <?php

$languages = array("React","C++","PHP","Python","Java","88",99);
// check if Golang exists in array
    $find = "Golang";
    if (in_array($find,$languages))
      echo $find." exists in the Array<br>";
    else
      echo $find." does not exist in the Array<br>";
?>

case sensitive 
php not find
99  give it will show
"99" it wil not exists strict mode


No comments:

Post a Comment

Event listening in react

 How we can listen to som eevents some envents fire like click or automatically user enters into input button , that is event on word type i...