Egypt's Dar al-Iftaa answers readers' questions in various fatwas. We at See publish these fatwas. The question says:
Does phlegm invalidate fasting, keeping in mind that it is a big inconvenience? Does swallowing it invalidate prayer?
Answer
There is a well-known opinion that swallowing phlegm does not invalidate fasting, just as it does not invalidate prayer (if swallowed during prayer.)
And God Almighty knows best.