Lopping through a URL

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
i have a loop running through an array of numbers, I want that loop to
connect to a url each time it passes a numbe.


the array has numbers: 1 , 2 , 3

i want the loop to connect to the url as follows:




any solution?

Re: Lopping through a URL

Maximus wrote:
Quoted text here. Click to load it

What do you mean by "connect" ?  Fetch the page?

$a = array(1, 2, 3);
foreach($a as $v) {
    $url = 'http://xxx.com/test.asp?id =' . $v;
    $str = file_get_contents($url);
    //do something with $str

Site Timeline