Anyway of getting music from iPhone onto mac?

Basically my mac hard drive crashed and it had to be wiped and repaired and everything's gone! My music is my life I know you can't do it from any apple software but is there any other way?

Itunes?

Actually the answer in this is an apple product. Your iphone should be connected to a cloud. This allows you to download your music from any device that is connected to the same apple ID. Download itunes and connect your apple id to itunes. Then some searching through the program you can download your music under a playlist called purchased.