Bilal Maqsood
0
Q:

how to search for a value in an array php

<?php 
// PHP function to illustrate the use of array_search() 
function Search($value, $array) 
{ 
    return(array_search($value, $array)); 
} 
$array = array("ram", "aakash", "saran", "mohan", "saran"); 
$value = "saran"; 
print_r(Search($value, $array)); 
?> 
1

New to Communities?

Join the community