in_array()
functionYou can use the PHP in_array()
function to test whether a value exists in an array or not.
Let's take a look at an example to understand how it basically works:
<?php
$zoo = array("Lion", "Elephant", "Tiger", "Zebra", "Rhino", "Bear");
if(in_array("Elephant", $zoo)){
echo "The elephant was found in the zoo.";
}
echo "<br>";
if(in_array("Tiger", $zoo)){
echo "The tiger was found in the zoo.";
}
?>
i hope you like this article.
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
jQuery and JavaScript Code Examples
In the previous article, we have discuss...Excel Export and Import in Laravel 8
In your admin side, you need to download...Autocomplete Search with Image and Custom HTML in jQuery
Today I will show you on your website to...How to configure SSH to use two factor authentication
SSH is the secure shell which is used to...Laravel orderBy on Eloquent Relationships example
Laravel eloquent relationships provides...