Php in_array() Function

Php in_array() function is used to search array or key values from entire array list and which function is returns TRUE the values are found and which function is returns FALSE the values are not found.also which functions are case sensitive.

Demo :



Array List :
 
Array Values Are :
Array Search :    

Example :

Just type a number or character to array list like this a , b ,c ,d and then click add button. Now will be to stored the value for array and display in this array values below of form .If you need to search that array values, type values at search box and then click search button the output will display at below side.

Following code is in_array function demo code if you need to download it.


<?php
$array_values = array();
$array_values = 'a,b,c,d';
$search_values = 'c';
echo in_array($search_values,$array_values) ? "In this value exist on the above array" : "In this value does not exist on the above array";
?>

In the above entire array list has been stored in $array_values variables and search values has been stored in $search_values variables.in the two variables are used in inside of in_array() functions.if match search values and array values the result will be In "this value exist on the above array" display otherwise "In this value does not exist on the above array".

Free Download Script :

If you need to in_array function demo code click and download from following link.

Download




Content