Execute this:

PHP Code: 
//***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]);
print_r($result); exit;
                        
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);
                } 
and let us know output