Son has runny diarrhoea.. need help

Hello. My son (4 months) has been having episodes of diarrhoea (4-5 nappies) since many days now. Few times it seems to have a greenish tinge and other times I have noticed few small white cottage cheese like balls which look like curdled milk. There has also been slight mucus at times. Has anyone experienced something similar? Could this be some sort of allergy?