How to upload music onto your itunes from your iphone?

I just got an iMac and I want to put all my music onto itunes.
All of my songs are on iTunes on my PC and i want to transfer all that music onto the iTunes on the mac.
I've tried several ways to transfer the music to the mac such as, syncing, backing up and so on and none of it has worked. I know there's a way to do it but I can't figure it out.

1. Go to YouTube (see link in Resources) and select the music video that you want to upload to iTunes. If you do not see the video that you are looking for, type the name of the video in the search box, and then click "Search." When you find the video, click it to begin playback. Copy the URL address located on the top of your web browser.
2. Go to an online YouTube conversion website such as Video2mp3.net, Listentoyoutube.com or Youtube-mp3.org. You should see a URL address box. These websites enable you to convert YouTube videos to MP3 audio completely free.
3. Paste the YouTube music video's URL address into the URL box, and then select the quality setting that you want to use if the conversion website that you are using offers this additional feature. Click "Convert," "Go," or "Convert video" depending on the conversion website that you are using. The website rips and converts the YouTube music video to MP3 format.
4. Click "Download," or "Download MP3." If you are using a Mac, the MP3 song download and launches automatically in iTunes when you click "Download," or "Download MP3." If you are using Windows, click "Save," after clicking "Download," or "Download MP3,"to launch the file saving dialog box. Select the folder to save the MP3 file, type a name for the file, and then click "Save."
5. Launch iTunes and click the "File" menu located on the top. Scroll down the pop-up menu and click "Add to Library" to launch the file import wizard. Select MP3 file from the folder that you saved it in, and then click "Open" to import it to iTunes.