If you want to get a PhD, your goal as an undergrad (in addition to learning as much as you can) should be to show your professors (who will eventually write your recommendation letters) that you have the qualities needed to succeed in graduate school. These include, for example: curiosity, creativity, perseverance, a strong work ethic, and a solid grounding in the basics of the field (such as calculus, linear algebra, and differential equations, in mathematics).
What you don't want from a letter writer is something like: "Leth was in my class and got an A". What you do want is for your letter writers to each share different anecdotes where you clearly display these qualities needed for success in graduate school.
One way to demonstrate these qualities is through a successful undergraduate research project. But undergraduate research is neither necessary nor sufficient. Two or three mediocre research projects is better than nothing, but not much. One strong project is much better than three weak ones.
But there are other ways to impress your letter writers. Maybe you do an independent study and really work your butt off, showing that you know how to learn on your own and that you have the passion and desire to make it happen. Or maybe it's not even an independent study; maybe it's just a class project where you really deliver far more than what is required. Your goal should be to make your letter writers more than happy to have you as a graduate student, if you were to apply to do graduate work with them.