I have something like this
<td><?php echo $row_rsPhoto['size']; ?></td>
and displays the file size in bytes, can do that in kilobytes, I'm trying to do this - function
public function size_as_kb()
{
if ($this->size < 1024) {
return "{$this->size} bytes";
} elseif ($this->size < 1048576) {
$size_kb = round($this->size/1024);
return "{$size_kb} KB";
} else {
$size_mb = round($this->size/1048576, 1);
return "{$size_mb} MB";
}
}
I do not know if this works and how to connect it $row_rsPhoto['size'];
with function
thank you in advance for your help