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

Hey Folks, It’s Worse Than We Thought — Claude’s Privacy Mess Just Got Bigger

  What started as a leak of shared Claude chats has turned into something much bigger — and much worse. The same thing is now happening with...