So I finally got back to trying to solve this problem. So I figured out how imap_fetchstructure() works, and I understand what it returns. Here's what I don't understand though:
So imap_fetchstructure() returns a object. object->part contains an array of objects. Those objects correspond to "parts" of a multipart message. So it's pretty each to loop through that array, checking each object. [remember, my goal is to find and 'get' only the text/plain portion of an email]
Here's what I don't understand though. So once I find the plain text part of a multipart message, how do I select it with imap_fetchbody()?
imap_fetchbody() is looking for you to specify which part you want with a code like "1.1". But how do you get that code from imap_fetchstructure()?
I think I now get how both of these functions work, I just don't understand how I make them work together.