View Single Post
  #7 (permalink)  
Old 08-14-2007, 03:15 AM
raj raj is offline
D-Web Programmer
 
Join Date: Jul 2007
Posts: 89
raj is on a distinguished road
Smile Re: How to Use Array's efficiently in PHP

Hi sabari,

Its ok, but ive made one small change in your code. It is checking only case sensitive in array...

so i have changed just one function : ereg to eregi. Now its working case insensitive.


$vSearchStr = "hi";
$Array = array("hello","hi mathew");
$Search=array();
foreach($Array as $key => $value)
{
if(eregi($vSearchStr,$value))
{
$Search[$key]=$value;
}
}
print_r($key);
Reply With Quote