PDA

View Full Version : How to process a list of URLs


koon85
08-24-2009, 01:03 AM
I have a list of URLs in a text box, each URL in one line of the text box has multiple lines. Now, I want to get the individual URLs and process it until there are no URL left. How can I do it in PHP?

Any suggestions will be appreciate! Thank you very much!

Dismounted
08-24-2009, 07:10 AM
$urls = explode("\n", $textbox);

foreach ($urls AS $link)
{
// something
}
Note that this does not check the validity of the URLs, and assumes that there is only one URL on each line.