Empty text file when there is over XXXX lines of text.


Posted on 16th Feb 2014 07:03 pm by admin


define("RANDOM_FILE","/public_html/random.txt");
$randomEntry = "This goes in text file.n";
{
$randomFile = fopen(RANDOM_FILE,"a");
}
fwrite($randomFile,$randomEntry);
fclose($randomFile);


This adds text to a random.txt file. How do you make it also empty the file when there is over say 1,000 lines of data?

Each line has 588 bytes of data, or 588K when it has 1,000 lines. How big does a text file need to be before it can slow the site down when the script looks for the random line?

No comments posted yet

Your Answer:

Login to answer
91 Like 5 Dislike
Previous forums Next forums
Other forums

j1inmis Ouput layout changes
Hi,

Can anybody tell how can j1inmis output layout can be changed so that vendor names ge

IP Logger for Voting Script
Can anybody help me place an IP logger into my voting script?
I know that maybe it is not as secu

Help =( !! Upload Pics [PHP script]
Hello
I need help with a php script [MULTIPLE UPLOAD IMAGES] , where I want to add a feature (wat

str_replace help
Hey there,

I'm a PHP newb, I'm having troubles with the str_replace function. I want to clean

CODE NOT WORKING
Code: [Select]<?php
//include shared codes

include '../lib/common.php';
include

Batch Related Pricing
Hi, I need some clarity on the batch related pricing

For example the following are the b

an interesting question
Greetings folks, got to ask an interesting question...

let say
i have created a function s

SOAP Issue
Hi,

I am facing some understanding problem with SOAP basic.kindly recommend some SOAP expert.

Little problem with form insertion in MySQL, Please help!!!
Hi!,

I'm a little bit new with php and I have a little issue here. I created a webform to ins

New Search Engine
Hey everyone,

I have a ZIP Code Radius search engine already functional. it displays all of t

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash