Hello, i am new coding. I am working on a auto downloading torrent php script.
I have been stucked with Undefined offset error. Your help will be very appretiated, thanks.
Notice: Undefined offset: 0 in /var/www/html/torrent/bgrahul.php on line 351
Notice: Undefined offset: 0 in /var/www/html/torrent/bgrahul.php on line 363
Marked those lines to bold and red.
I have been stucked with Undefined offset error. Your help will be very appretiated, thanks.
Notice: Undefined offset: 0 in /var/www/html/torrent/bgrahul.php on line 351
Notice: Undefined offset: 0 in /var/www/html/torrent/bgrahul.php on line 363
Marked those lines to bold and red.
//***Check whether torrents are complete***
$check = true;
while ($check) {
$c = 0;
foreach ($id as $value) {
$result = callTransmission(array("fields" => array("id", "name", "percentDone"), "ids" => array($value)), "torrent-get", $arr[1]);
preg_match('/"percentDone":[0-9.]+/i', $result[0], $matches);
$adii = substr($matches[0], 14);
$anuj = (int) ($adii * 100);
update_progress($anuj); //CALL FUNCTION
$anujstatus = "Download In Progress";
$downcomplete = "Download Finished";
anujstatus($anujstatus);
if ($anuj=='100') {
aditya(100);
anujstatus($downcomplete);
echo "<br><br><br><br> Download complete";
break 2;
}
if ($matches[0] == '"percentDone":1.0000')
$c++;
}
if ($c==count($id)) {
$check = false;
break 2;
}
sleep(5);
}