element_in_array.php :
<?php
// Checking if an Element Is in Array or not
$num=array(1,2,3,4,5,6,7,8,9,10);
$element=$_POST['element'];
if (in_array($element, $num)) {
echo 'element found';
}
else
{
echo 'element not found';
}
?>
============================================================
element_in_array_index.php :
<center><b>here checks data is in array or not</b><br><br>
<center><form action="element_in_array.php" method="POST">
<input type="textbox" name="element">
<input type="submit" name="submit">
</form>
============================================================
input :
1) give the array values in text box
2) click in button
ex :
array :$num=array(1,2,3,4,5,6,7,8,9,10);
here 0-9 array indexes
and
1-10 array values
============================================================
output :
1) element found
2) element not found
<?php
// Checking if an Element Is in Array or not
$num=array(1,2,3,4,5,6,7,8,9,10);
$element=$_POST['element'];
if (in_array($element, $num)) {
echo 'element found';
}
else
{
echo 'element not found';
}
?>
============================================================
element_in_array_index.php :
<center><b>here checks data is in array or not</b><br><br>
<center><form action="element_in_array.php" method="POST">
<input type="textbox" name="element">
<input type="submit" name="submit">
</form>
============================================================
input :
1) give the array values in text box
2) click in button
ex :
array :$num=array(1,2,3,4,5,6,7,8,9,10);
here 0-9 array indexes
and
1-10 array values
============================================================
output :
1) element found
2) element not found