PHP ट्रिगर_एरर () फ़ंक्शन
उदाहरण
यदि $usernum > 10, एक त्रुटि ट्रिगर करें:
<?php
if ($usernum>10) {
trigger_error("Number cannot be larger than 10");
}
?>
परिभाषा और उपयोग
ट्रिगर_एरर () फ़ंक्शन एक उपयोगकर्ता-स्तरीय त्रुटि संदेश बनाता है।
ट्रिगर_एरर () फ़ंक्शन का उपयोग बिल्ट-इन एरर हैंडलर के साथ या सेट_एरर_हैंडलर () फ़ंक्शन द्वारा सेट किए गए उपयोगकर्ता-परिभाषित फ़ंक्शन के साथ किया जा सकता है ।
वाक्य - विन्यास
trigger_error(message, type)
पैरामीटर मान
Parameter | Description |
---|---|
message | Required. Specifies the error message for this error. Max 1024 bytes in length |
type | Optional. Specifies the error type for this error. Possible values:
|
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | FALSE यदि गलत त्रुटि प्रकार निर्दिष्ट किया गया है, तो TRUE अन्यथा |
---|---|
पीएचपी संस्करण: | 4.0.1+ |
पीएचपी त्रुटि संदर्भ