Posted by ZeldorBlat on 03/10/06 16:44
Maximus wrote:
> 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.
>
> example:
>
> the array has numbers: 1 , 2 , 3
>
> i want the loop to connect to the url as follows:
>
> http://xxx.com/test.asp?id=1
>
> http://xxx.com/test.asp?id=2
>
> http://xxx.com/test.asp?id=3
>
>
> any solution?
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
}
[Back to original message]
|