<?
for ($i=0; $i<=9; $i++) {
$b=urlencode($cl[1][$i]);
$ara = array("http://anonymouse.org/cgi-bin/anon-www.cgi/", "http%3A%2F%2Fanonymouse.org%2Fcgi-bin%2Fanon-www.cgi%2F");
$degis = array("", "");
$t = str_replace($ara, $degis, $b);
$c="$t";
$base64=base64_encode($t);
$y=urldecode($t);
$u=base64_encode($y);
$qwe = "http://anonymouse.org/cgi-bin/anon-www.cgi/$y";
$ewq = "h.php?y=$u";
$bul = ($qwe);
$degistir = ($ewq);
$a =str_replace($bul, $degistir, $ic);
}
?>
當我把$cl[1][0], $cl[1][1], $cl[1][2]
工程成功,但是當我把$i
其返回null。爲什麼發生這種情況?爲什麼這個for循環返回null?
**我想每一個URL更改爲我從preg_match_all遠程網址**
有趣的一段代碼。 – fabrik 2010-08-27 08:08:08
你對所有的返回值做什麼?就目前而言,每個循環中都會覆蓋$ base64。 – 2010-08-27 08:09:20
你能描述一下你想要做什麼嗎?因爲它看起來過於複雜。你的目標是在開始時或者在字符串的其他位置去掉'http://'前綴?前者有更好的方法 – 2010-08-27 08:10:42