$post[attachmentid] $filepath="$attachpath/$post[hash].file"; if ($post[attachmentid] && is_file($filepath)) { $post[attachsize] = sprintf('%.2f',filesize($filepath)/1024); } else { $post[attachsize] = ""; }