php regex test

Solutions on MaxInterview for php regex test by the best coders in the world

showing results for - "php regex test"
Fabio
20 May 2016
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?>