--TEST-- Test imap_fetchbody() function : basic functionality --EXTENSIONS-- imap --SKIPIF-- --FILE-- FT_UID, 'FT_PEEK' => FT_PEEK, 'FT_INTERNAL' => FT_INTERNAL); // Calling imap_fetchbody() with all possible arguments echo "\n-- All possible arguments --\n"; foreach ($options as $key => $option) { echo "-- Option is $key --\n"; switch ($key) { case 'FT_UID'; $msg_uid = imap_uid($stream_id, $msg_no); var_dump( imap_fetchbody($stream_id, $msg_uid, $section, $option) ); break; case 'FT_PEEK'; var_dump( imap_fetchbody($stream_id, $msg_no, $section, $option) ); $overview = imap_fetch_overview($stream_id, 1); echo "Seen Flag: "; var_dump( $overview[0]->seen ); break; case 'FT_INTERNAL'; var_dump( imap_fetchbody($stream_id, $msg_no, $section, $option) ); break; } } // Calling imap_fetchbody() with mandatory arguments echo "\n-- Mandatory arguments --\n"; var_dump( imap_fetchbody($stream_id, $msg_no, $section) ); $overview = imap_fetch_overview($stream_id, 1); echo "Seen Flag: "; var_dump( $overview[0]->seen ); ?> --CLEAN-- --EXPECTF-- *** Testing imap_fetchbody() : basic functionality *** Create a temporary mailbox and add 1 msgs New mailbox created -- All possible arguments -- -- Option is FT_UID -- string(36) "message 2:yyyyyyyyyyyyyyyyyyyyyyyyyy" -- Option is FT_PEEK -- string(36) "message 2:yyyyyyyyyyyyyyyyyyyyyyyyyy" Seen Flag: int(%d) -- Option is FT_INTERNAL -- string(36) "message 2:yyyyyyyyyyyyyyyyyyyyyyyyyy" -- Mandatory arguments -- string(36) "message 2:yyyyyyyyyyyyyyyyyyyyyyyyyy" Seen Flag: int(%d)