Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Write a String to a File with a File Handle
How To Write a String to a File with a File Handle? - PHP Script Tips - Reading and Writing Files
✍: FYIcenter.com
If you have a file handle linked to a file opened for writing, and you want to write a string to the file, you can use the fwrite() function. It will write the string to the file where the file pointer is located, and moves the file pointer to the end of the string. Here is a PHP script example on how to use fwrite():
<?php
$file = fopen("/temp/todo.txt", "w");
fwrite($file,"Download PHP scripts at dev.fyicenter.com.\r\n");
fwrite($file,"Download Perl scripts at dev.fyicenter.com.\r\n");
fclose($file);
?>
This script will write the following to the file:
Download PHP scripts at dev.fyicenter.com. Download Perl scripts at dev.fyicenter.com.
2007-04-23, 5446👍, 0💬
Popular Posts:
1. What is normalization. 2. Difference between procedure and functions. 3. Oracle 9i Vs 10g. 4. how...
Jack developed a program by using a Map container to hold key/value pairs. He wanted to make a chang...
What will be printed as the result of the operation below: main() { int a=0; if (a==0) printf("Cisco...
How To Increment Dates by 1? - MySQL FAQs - Introduction to SQL Date and Time Handling If you have a...
Can you have virtual functions in Java? Yes, all functions in Java are virtual by default. This is a...