Checking searching presence of an element inside an array

We can check or search the presence of an element inside an array by using in_array function in PHP. The script below will create an array with some element and then will apply the in_array function to check the presence of an element.

This function will return True or False based on the presence of the search element.

$value=array("Rabin","Reid","Cris","KVJ","John");

if(in_array("Cris",$value)){
echo "Cris is there inside the array";}
else{ echo "Cris is not there ";}
Similar function in searching an array in ASP is Filter()

Subscribe to our mailing list

* indicates required
Subscribe to plus2net
Visitors Rating
Your Rating


Google+

subhendu

18-06-2012

nice site

Post Comment This is for short comments only. Use the forum for more discussions.




Subscribe to our mailing list

* indicates required
Subscribe to plus2net
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us
©2000-2018 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer