How can you check if a text variable contains uppercase letters in PHP?

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

$text = "This is a Text with Uppercase Letters";
if (preg_match('/[A-Z]/', $text)) {
    echo "The text contains uppercase letters.";
} else {
    echo "The text does not contain any uppercase letters.";
}