Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open and write file

Status
Not open for further replies.

mike314

Programmer
Jun 24, 2003
143
US
Stupid qestion but I have some php that loops through a file using the file array and prints it out. Thats great but is there a way for me to loop through the file and save that array to a new blank file????

<?php
$lines = file('test.xml);
foreach ($lines as $line_num => $line) {
echo htmlspecialchars($line) . "<br />\n";
}

?>

thanks!
 
Try [blue]fopen()[/blue] and [blue]fwrite()[/blue], form the PHP online manual.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top