I want to get the size of a file, remove the last 3 chars from the size string, and place a comma where it should be.... this is what i got:
$size = filesize('files/arnold/'.$listsongs[$b]); // lets say the size is 6756453 bytes
$size = substr_replace($size, '', -3, 3); //takes off the last 3 chars
if (strlen($size) > 3) // if it should have a comma...
{
$sizelast = substr($size, -3);
$sizefirst = substr_replace($size, '', -3, 3);
$size = $sizefirst.",".$sizelast;
}
// $size would be '6,756'
now.. this works fine, i was just wondering if there was a simpler way to do it.