CHAPTER 9
■
PERFORMING FORM VALIDATION
WITH REGULAR EXPRESSIONS
317
TEST_DATA;
/*
* Use str_ireplace() to highlight any occurrence of the word
* "regular"
*/
echo str_ireplace("regular", "
regular", $string);
/*
* Use preg_replace() to highlight any occurrence of the word
* "regular"
*/
echo preg_replace("/regular/i", "
regular", $string);
?>
/*
* Store the sample set of text to use for the examples of regex
*/
$string = <<
Do'stlaringiz bilan baham: