How to transfer All my music from iphone to computer?

I reformatted my laptop and I lost all of my music that was on it because of it. The only music that I have for it now is on my iphone but i can't seem to get the music to transfer onto my computer. I'm getting aggrivated because i'm not going to buy a program online to transfer all of my music (606 songs) to my computer. The programs I keep finding from youtube or just a general search are all just trials that only move over 60 songs, 100 songs, 3 songs, etc. In the the trial version. I know how to transfer music from a IPOD by unhiding the files but obviously it doesn't work the same. I no longer have a Ipod. Thats why i can't just use that to do all of this. Does ANYONE know how to transfer music from the IPHONE to the computer?

Ta-DA!

http://osxdaily.com/2012/06/04/transfer-music-from-iphone-ipod-or-ipad-to-computer/

For free.

I had the same problem because I my iPhone's broken. I searched on the website and found 4Videosoft iPad to Computer Transfer Ultimate. I transferred all my iPhone files to my computer for backup. It's very easy to use and you can find more information on the website to have a free trial.