Answers for "php regex test"

PHP
0

php regex test

* Lets suppose, we want to test a string variable that contain exactly "Abc" in it.
So we can do it using .......

<?php
$str = "I am Abc.";
$pattern = "/Abc/i";
if (preg_match($pattern, $str))
{
	echo "True.";
}
else
{
	echo "False.";
}
?>
Posted by: Guest on March-11-2021

Browse Popular Code Answers by Language