Page 1 of 1

Reading a file and finding and opening the links in it.

Posted: Tue Jan 20, 2009 12:56 am
by sheikhmdirfan
hi all,

I have a file containing links to other web pages.

While reading the file i want to be able to find out the hyperlinks from the rest of the text and open them as well.

Re: Reading a file and finding and opening the links in it.

Posted: Tue Jan 20, 2009 2:09 am
by php_ghost
I've done a script that does the same thing.

Use PHP's file function (or any other similar function that does the same thing) to read the contents of the file.
And I suggest you read on regular expressions in PHP to capture the links inside the file.

Re: Reading a file and finding and opening the links in it.

Posted: Tue Jan 20, 2009 2:28 am
by papa
You'll probably find a couple of good regexps on google if you like.