false))); } $pct = 0; $size = 0; if (is_array($status)) { if (array_key_exists('total', $status) && array_key_exists('current', $status)) { if ($status['total'] > 0) { $pct = round(($status['current'] / $status['total']) * 100); $size = round($status['total'] / 1024); } } } echo json_encode(array('success' => true, 'pct' => $pct, 'size' => $size));