पीएचपी fwrite () समारोह
❮ पीएचपी फाइल सिस्टम संदर्भउदाहरण
एक खुली फ़ाइल में लिखें:
<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
?>
उपरोक्त कोड का आउटपुट होगा:
21
परिभाषा और उपयोग
fwrite() एक खुली फाइल को लिखता है।
फ़ंक्शन फ़ाइल (ईओएफ) के अंत में या जब यह निर्दिष्ट लंबाई तक पहुंच जाता है, जो भी पहले आता है, बंद हो जाएगा।
वाक्य - विन्यास
fwrite(file, string, length)
पैरामीटर मान
Parameter | Description |
---|---|
file | Required. Specifies the open file to write to |
string | Required. Specifies the string to write to the open file |
length | Optional. Specifies the maximum number of bytes to write |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | लिखे गए बाइट्स की संख्या, विफलता पर FALSE |
---|---|
पीएचपी संस्करण: | 4.0+ |
बाइनरी सुरक्षित: | हां |
❮ पीएचपी फाइल सिस्टम संदर्भ