hi,
how to search the string value in array.
ex: if my array contains
$ar1=array("activate"=>"1","activated"=>"3","provi de"=>"1","activating"=>"2","providing"=>"3","provi ded"=>"2","hello"=>"6");
then how to search the string word activate exists in array or not
from the above array. while searching it has to search for array key contains activate and it has retreive the data of string contains active i.e my output as to come as active,activatednactivating

it has search for activate and display the result as 3 times bcz activate is there exists three rimes. how to find

    Here are two ways of doing it. Look up [man]isset[/man] and [man]array_key_exists[/man]

    if (isset($ar1['activate']))
    {
        // do something
    }
    
    if (array_key_exists('activate', $ar1))
    {
        // do something
    }
      Write a Reply...