Wzór wystapnia na końcu stringa

// create a string
$string = 'abcdefghijklmnopqrstuvwxyz0123456789.pl';

// try to match our pattern at the end of the string
if(preg_match("/.pl\z/i", $string))
        {
    // if our pattern matches we echo this 
        echo 'The string ends with .pl';
        }
else
        {
    // if no match is found we echo this line
        echo 'No match found';
        }

https://www.phpro.org/tutorials/Introduction-to-PHP-Regex.html

Komentarze wyłączone