Matching "*" using preg_match. Please help

HI,

I need to search for “*” in $value. The below code is not matching. Please help.


		if(preg_match('/(*)/i',$value))
		{
			$fields.="";
			echo "* is selected<br>";
        }

Thanks,
Ramki

May be this will help you mate!

http://www.php.net/manual/en/function.preg-match.php

Don’t use regular expressions to test if a simple string is contained in another string


if(false !== strpos($value, '*')) {
   echo "* is selected<br>";
}

Also, there’s no point appending an empty string to $fields, it changes nothing.