I have a groups.txt file with some text datas on it. Datas are listed in the text as; Nockin:JJKEL Nursan:OLZK Besat:JKANW Sucan:QQOW I want to write first data (by reading groups.txt) to php page then remove it from the list. So first visitor will see the: Nockin:JJKEL Second visitor will see the: Nursan:OLZK Third visitor will see the Besat:JKANW And so on! I can also pay for this. Upon request.
Use this, it'll display the string on the first line, then that on the second line, etc, as each successive visitor visits it. It should work, or at least it does for me... <?php $fileName = 'groups.txt'; chmod($fileName, 0777); $fileArray = file($fileName); echo $fileArray[0]; unset($fileArray[0]); file_put_contents($fileName, $fileArray); ?> PHP: Please note that this above physically deletes each line from the text file as it is displayed. If you want this not to happen, use this code below and give people links like FILENAME-HERE.php?id=ID-NUMBER-HERE, where ID-NUMBER-HERE is the line number in the text file and FILENAME-HERE is (of course) the filename of this php code below. <?php $userID = intval($_GET['id']) - 1; $fileName = 'groups.txt'; $fileArray = file($fileName); echo $fileArray[$userID]; ?> PHP: No thanks, just +rep if I've helped