prattmic Posted August 15, 2006 Author Share Posted August 15, 2006 bump Quote Link to comment Share on other sites More sharing options...
prattmic Posted August 15, 2006 Author Share Posted August 15, 2006 bump Quote Link to comment Share on other sites More sharing options...
redarrow Posted August 15, 2006 Share Posted August 15, 2006 Have you read the manual yet on files ? Quote Link to comment Share on other sites More sharing options...
prattmic Posted August 15, 2006 Author Share Posted August 15, 2006 no, I haven't Quote Link to comment Share on other sites More sharing options...
prattmic Posted August 15, 2006 Author Share Posted August 15, 2006 bump Quote Link to comment Share on other sites More sharing options...
prattmic Posted August 17, 2006 Author Share Posted August 17, 2006 bump Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted August 17, 2006 Share Posted August 17, 2006 [code]<?php$file = "./logs.txt";$limit = "5";$log = file($file);$lines = count($log);if ($lines > $limit + 19){ if (!$handle = fopen($file, 'w')) { echo "Cannot open file ($file)"; exit; } for ($i = 0; $i <= 18; $i++) { fwrite($handle, $log[$i]); unset($log[$i]); } $i = 0; while (count($log) > $limit) { unset($log[$i]); $i++; } foreach ($log as $line) { fwrite($handle, $line); } fclose($handle); } ?>[/code]Don't beg for code in the future please. Quote Link to comment Share on other sites More sharing options...
prattmic Posted August 17, 2006 Author Share Posted August 17, 2006 It worked! Thank you so much! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.