function archive_attachment($aid,$key) { if (!$aid) return; $oattachment=new attachment(); $attachment=$oattachment->getrow('aid='.$aid); if (is_array($attachment) &&isset($attachment[$key])) return $attachment[$key]; else return; }