Period & the pill

Can I take the pill on the first day of my period to make it stop? My doctor told me that awhile ago but I just want a second opinion.