After connecting your iPhone to the computer and its icon appears in iTunes, you can choose Transfer Purchases from iPod from the File menu.
Or you can right-click (Windows or Mac) or Control-click (Mac only) your iPhone in the iTunes Source list, then choose Transfer Purchases from the shortcut menu that appears.
Please note that this feature only works for items that were purchased on the iTunes Store. Any items imported from audio CDs or acquired from other sources will not copy from your iPod or iPhone to the iTunes library.
What's more,this articlehow to transfer music from iPhone to computer
maybe can make a effort of transfering iPhone music to computer.
Hope that helps you out.
Edited by winan (Wed 10-Aug-11 07:18:22)