पीएचपी रीडफाइल () फंक्शन
❮ पीएचपी फाइल सिस्टम संदर्भउदाहरण
एक फ़ाइल पढ़ें:
<?php
echo readfile("test.txt");
?>
परिभाषा और उपयोग
रीडफाइल () फ़ंक्शन एक फ़ाइल को पढ़ता है और इसे आउटपुट बफर को लिखता है।
युक्ति: यदि आप php.ini फ़ाइल में fopen रैपर सक्षम किए गए हैं, तो आप इस फ़ंक्शन के साथ फ़ाइल नाम के रूप में URL का उपयोग कर सकते हैं।
वाक्य - विन्यास
readfile(file, include_path, context)
पैरामीटर मान
Parameter | Description |
---|---|
file | Required. Specifies the file to read |
include_path | Optional. Set this parameter to TRUE if you want to search for the file in the include_path (in php.ini) as well |
context | Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | सफलता पर पढ़े गए बाइट्स की संख्या, FALSE और विफलता पर त्रुटि। आप फ़ंक्शन नाम के सामने '@' जोड़कर त्रुटि संदेश छुपा सकते हैं |
---|---|
पीएचपी संस्करण: | 4.0+ |
पीएचपी चेंजलॉग: | पीएचपी 5.0: जोड़ा गया संदर्भ समर्थन |
❮ पीएचपी फाइल सिस्टम संदर्भ