I am trying to remove all the text before the URL and the text after the file name. The result of the following code is an output of the original input .txt file with nothing removed from the lines.

If I remove the unwanted text before processing the file I am able to break apart the URL perfectly. I want to be able to remove the unwanted text within the PHP page.

Here is the format of the log I am working with.
07/01/2004.07:05:44a [Nick] http://www.mydomain.com/filename.swf this file rocks
What I have tryd so far with parse_url is not working for me.
PHP Code:
$opfile "buffer_clean.txt";
// open the url to be read
$fd fopen($ipffile,"r") or die ( "Server is not responding...." ) ; 
$fp fopen($opfile,"w+");

while (!
feof ($fd)) {
$url_parts parse_url($url);
$url)) { 
$scheme $url_parts['scheme'];
$user $url_parts['user'];
$pass $url_parts['pass'];
$host $url_parts['host'];
$port $url_parts['port'];
$path $url_parts['path'];
$fragment $url_parts['fragment'];
$query $url_parts['query'];

// Break the link into its parts and finish processing

glue_url ($url_parts);
// write the contents of the url to the file 
// read the file and just rewrites it out to the clean.txt file
fwrite ($fp$url);