Re: writing to files

From: Date: Wed, 27 Sep 2000 10:10:01 +0000
Subject: Re: writing to files
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-17689@lists.php.net to get a copy of this message
Generic Player writes: > Here is what I am doing. I wrote a script to update news.txt and > copy what was in it to an aold archive.txt. Problem is I want to have > the archived news displayed with the most recent article at the top. > Any way to do that without storing news items in a database or > seperate .txt files for each news item? If this is on some kind of unix system you could just do this: exec( "cat $NEWSPATH/archive.txt >> $NEWSPATH/news.txt;" . "mv $NEWSPATH/news.txt $NEWSPATH/archive.txt" ); -robin -- Robin Vickery............................................... Planet-Three, 3A West Point, Warple Way, London, W3 0RG, UK Email: robin@planet-three.net Phone: +44 (0)870 729 5444

« previous php.general (#17689) next »