Problems with file writing
Posted: Sat Apr 28, 2007 3:35 pm
I have problems with this function, it dosent want to work, it returns empty array.

Code: Select all
function deleteLine($line_num) {
$content = $this->readFile();
unset($content[$line_num]);
$fp = fopen($this->filename, 'w+');
flock($fp, LOCK_EX);
foreach ($content as $line) {
fwrite($fp, $line, 4029);
}
flock($fp, LOCK_UN);
fclose($fp);
}