cramps/pain

Can you prevent cramps during period? I have really bad pain and have to take pain relieve for first 3-4 days constantly. Some people told me if you strengthen your core that would help. What do you think?