Q: Error in preg_match PHP <?php

$str = "asd,ad";
if(preg_match(",",$str)) { 
    echo "ok";
}

?

It outputs me 

No ending delimiter ',' found in....

?>

A: your pattern can be replaced to strpos instead
if(strpos($str, ",")!==false)
{
   echo "ok";
}


A: You are missing delimitters, try this:
$str = "asd,ad";
if(preg_match("/,/",$str)) { 
    echo "ok";
}

To find out more instances, you may want to use preg_match_all function too.
