Source Code:
(back to article)
<?php $pattern = '/^This is a test$/'; $string = 'This is a test'; $quoted_pattern = preg_quote($pattern, ''); if (preg_match($quoted_pattern, $string)) { echo 'Match found.'; } else { echo 'No match found.'; }
Result:
Report an issue