Is there anyway to transfer music from my iPhone to my computer?

I recently had to replace my computers hardrive and with it I lost all my music library. Is there any way I can transfer the music from my IPhone to my computer (it's a PC)

Have you tried syncing it?

Sariah's right. Just sync it on itunes, then search for the songs on your computer or just straight from itunes

If you purchased all of the songs through itunes store, please follow these steps:
1. Open up Itunes and Click on Itunes Store
2. Once you're in the Itunes Store look to right side of the screen and you should see the word "purchased". Click purchased and you'll be sent to a purchase screen.
3. Click on "All Songs" and then it will show all the songs you've downloaded. From there you just hit the button that looks like a cloud with an arrow on it, and it will download all the songs all over again.

If you didn't purchase them through Itunes, then you'll have to download software that will strip the songs from your iPod/iPhone onto your computer. And here is a step by step guide show you how to do that.
http://www.ipod-transfer-copy.com/how-to-transfer-music-from-ipod-to-computer-itunes.html
Hope it helps. Feel free to email me if you need further help.

Two ways to do that.
If you purchased your music from iTunes Store. You can redownload them to your iTunes after you log in your account.
If you did not purchased them from Apple. You need to use third party software to transfer your music from iPhone to your computer easily.
Aiseesoft FoneTrans is the one you need. It can transfer music from your iPhone to your computer/iTunes easily. It can also transfer photos, pictures, videos, sms, contacts and other files from your iPhone to your computer easily. It can also transfer music from one iPhone to another iPhone and from computer to iPhone.
You can find more info here:
http://www.iphone-datarecovery.com/iphone-transfer/

Hope it can help you.

You can try the O2Tunes software. It's easy to transfer music between your Apple devices and your pc. Apple devices are easier to manage with iTunes alternative. Good luck. Is there anyway to transfer music from my iPhone to my computer - 1