How can one check if a string contains uppercase characters in PHP?

To check if a string contains uppercase characters in PHP, you can use the `preg_match` function with a regular expression pattern that matches uppercase letters. The pattern `[A-Z]` will match any uppercase letter in the string. If `preg_match` returns a positive integer, it means that the string contains at least one uppercase letter.

$string = "Hello World";
if (preg_match('/[A-Z]/', $string)) {
    echo "String contains uppercase characters.";
} else {
    echo "String does not contain uppercase characters.";
}