有什么理由我不能在函数中推送这些变量? 如果我这样做
//function scraping_for_text_2
for($i=0; $i<$l; $i++) {
echo "$contents[$i]";
echo "$fnamearray[$i].torrent";
}
它回应了正确的vaules
但是当我有这样的功能时
function scraping_for_text_2($iUrl,$iText)
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $uploadurl);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$curlresult = curl_exec($curl);
curl_close ($curl);
$data = array(
"description" => "testing",
"torrent" => "@$fnamearray[$i]",
"submit" => "Upload"
);
我得到了这个
注意:未定义的变量:fnamearray
注意:未定义的变量:i in