I am using the following code to look for semi-colons and commas in a $subject. While each works individually, if I make a string (like “,;”)that combines semi-colon AND a comma, only the comma function works. (It reads “comma found”.)
if (preg_match('/^;$/', $subject))
{
echo "semi colon found";
}
if (preg_match('/^,$/', $subject))
{
echo "comma found";
}