function doc_links_fileSize($filesize){
if ($filesize < 1024) return $bytes.'B';
elseif ($filesize < 1048576) return round($filesize / 1024, 2).'KB';
elseif ($filesize < 1073741824) return round($filesize / 1048576, 2).'MB';
elseif ($filesize < 1099511627776) return round($filesize / 1073741824, 2).'GB';
else return round($bytes / 1099511627776, 2).'TB';
}
function images_links_fileSize($filesize){
if ($filesize < 1024) return $bytes.'B';
elseif ($filesize < 1048576) return round($filesize / 1024, 2).'KB';
elseif ($filesize < 1073741824) return round($filesize / 1048576, 2).'MB';
elseif ($filesize < 1099511627776) return round($filesize / 1073741824, 2).'GB';
else return round($bytes / 1099511627776, 2).'TB';
}
How can i combine two function which returns same value .I want to reduce the code by combining two functions ,as the both functions return same value