View Single Post
  #4 (permalink)  
Old Feb 9th, 2008, 01:35
alexgeek's Avatar
alexgeek alexgeek is offline
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,799
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Edit a specific line of a file???

This should work:
<font color="#000000">
PHP: Select all

<?php
$filehandle 
fopen("template/templateHeader.inc""r");
$file fread($filehandle);
$lines explode("\n",$file);
$lines[4] = "new line 5";
$file implode("\n"$lines);

fputs($file"$file");
fclose($file);
?>
Reply With Quote