If sputum of phlegm does not reach the mouth, then it does not break the fast, and there is only one opinion on this in the Mathhab.
If it does reach the mouth, then he swallows it, the scholars hold two opinions regarding it:
Some of them hold that it breaks the fast, including it in the same category as food and drink. Others hold that it does not break the fast, including it in the same category as saliva, for saliva does not break the fast, even if one collected his saliva and swallowed it, his fast is not invalidated.
When the scholars disagree, it is necessary to refer to the Book (of Allaah) and the Sunnah; and if we are in doubt at to whether this matter invalidates the act of worship or it does not invalidate it, then the basic principle is that it is not invalidated and based upon this, swallowing sputum does not break the fast.
The important thing is that a person leaves his sputum, and does not try to draw it into his mouth, then he should expel it, whether he is fasting or not. As for breaking the fast, it requires an evidence which will be a convincing proof for a person before Allaah, the Almighty, the All-Powerful, for the invalidation of the fast.