How can a PHP developer determine if a string ends with a specific pattern, such as "number x number"?

To determine if a string ends with a specific pattern like "number x number", a PHP developer can use the `preg_match` function with a regular expression pattern that matches the desired format. The regular expression pattern should check for a number followed by the letter 'x' and another number at the end of the string. If the pattern is found at the end of the string, the function will return true, indicating that the string ends with the specified format.

$string = "Lorem ipsum 10x20";
$pattern = "/\d+x\d+$/";

if (preg_match($pattern, $string)) {
    echo "The string ends with the specified pattern.";
} else {
    echo "The string does not end with the specified pattern.";
}