1* Lets suppose, we want to test a string variable that contain exactly "Abc" in it.
2So we can do it using .......
3
4<?php
5$str = "I am Abc.";
6$pattern = "/Abc/i";
7if (preg_match($pattern, $str))
8{
9 echo "True.";
10}
11else
12{
13 echo "False.";
14}
15?>