HI,
I need to search for "*" in $value. The below code is not matching. Please help.
Thanks,Code:if(preg_match('/(*)/i',$value)) { $fields.=""; echo "* is selected<br>"; }
Ramki
| SitePoint Sponsor |

HI,
I need to search for "*" in $value. The below code is not matching. Please help.
Thanks,Code:if(preg_match('/(*)/i',$value)) { $fields.=""; echo "* is selected<br>"; }
Ramki
May be this will help you mate!





Don't use regular expressions to test if a simple string is contained in another string
Also, there's no point appending an empty string to $fields, it changes nothing.PHP Code:if(false !== strpos($value, '*')) {
echo "* is selected<br>";
}
Bookmarks