What is the significance of the "^" symbol inside square brackets in a regular expression pattern?

The "^" symbol inside square brackets in a regular expression pattern signifies negation or exclusion. It is used to match any character except the ones specified within the square brackets.

// Example code snippet:
$string = "Hello123";
if (preg_match("/[^0-9]/", $string)) {
    echo "String contains characters other than numbers.";
} else {
    echo "String contains only numbers.";
}