Hi all, 

Im trying to delete a line from a file after having first read the line.  
The file contains a list or urls, one per new line: like this:

urls.txt
http://example.com/somedir/
http://www.example.com/page.php?name=Nick+W

Here's what I have so far:

<?php
  $file = 'urls.txt';
  $f = fopen($file, 'r+');
  $url2use = fgets($f);
  fseek($f, 0);
  fwrite($f, '', strlen($url2use)); // Where is the "gotha"?
  print($url2use);
  fclose($f);
?> 

Clearly im using fwrite incorrectly (at least i think that's clear ;-)
but i cant seem to figure out what im doing wrong? (well, i kinda can
but i cant get any further with it without a little help..)

Much thanks for your time...
-- 
Nick W

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to