我试图找出一种在循环中重定向到不同 url 的方法。
例如......我有这个网址:
http://mydomain.com/subfolder/1
我需要上面 url 末尾的 1 在循环中每次增加 1
所以它会这样做:
redirect here - http://mydomain.com/subfolder/1
redirect here - http://mydomain.com/subfolder/2
redirect here - http://mydomain.com/subfolder/3
所以它会去:
while (a < 100) {
header("Location: http://mydomain.com/subfolder/" Increment number here );
}
我怎样才能在 PHP 中做到这一点?