As L.Dutch already wrote, if it's in plastic, keeping it in there is probably the best way of storing it, as their blog post states that broccoli wrapped that way can remain fresh for up to 20 days after harvesting, instead of just 5 days for ones that weren't wrapped. There will always be time between harvesting and you buying the broccoli, so keep in mind that a wrapped broccoli won't stay fresh for 20 days after buying.
Otherwise, the periods you mention in your comment seem pretty 'normal' though. If your broccoli didn't come in plastic wrap, according to my goto Dutch site broccoli stays fresh for about 1-2 days if not refrigerated, and for 3-5 days if refrigerated, without cutting it into florets. Cutting up the broccoli will reduce how long you can keep it.
There is one other way of storing broccoli that keeps coming back across blog posts, and that is the broccoli bouquet:
You can keep your broccoli fresh by placing it in a small vase or cylindrical container with cold water. Place your broccoli stems into a bowl or container with a half-inch of water at the bottom. The broccoli heads should be sticking out of the container. Cover the heads loosely with plastic wrap and place them in the refrigerator. Change out the water each day, and the broccoli will keep for a week in the fridge.
I've never tried this, but it should prolong the 3-5 days it usually lasts when refrigerated to up to a week. It's quite a lot more work though, as you have to refresh the water each day.