Copy music from iPhone to new iTunes library?

My laptop with my complete iTunes library broke and is no longer usable, and I now only have my music on my iPhone 4.Is there any way of transferring my music from my iPhone, or through my iTunes account, onto a different iTunes on a new laptop?

Open iTunes, click file, "transfer purchases".

Buy software like iexplorer or ifunbox. They will access our iphone through your new computer and you cam copy everything from it including music and photos

To help you manage the transference, you can refer to a third party named iTransfer. As a tool exclusively designed to make the transference between iOS devices and iTunes happen. With it, what you get to do is just connect the iOS device, choose the files to transfer and then click "Transfer Now" button.