HDMI Capabilities
The ideal connection for consumer entertainment centers is with HDMI. Instead of dealing with a tangle of cords leading from one device to another, you can transmit all video and audio data by a single HDMI cord. This cable can accommodate up to 1080p video, which is the current best picture resolution for general consumer products, and it supports 7.1 surround sound. Additionally, select devices can even use HDMI cords to transfer data and provide Internet access over that cord, eliminating the need for an Ethernet cord or a potentially slower Wi-Fi connection.
PS3 HDMI Connections
The HDMI cord plugs into the HDMI port on the back of your PS3, and from there, you can plug it directly into your TV as long as it has its own HDMI port. If you only use your TV's speakers, you'll have stereo sound but not surround sound, since surround sound nearly always requires an AV receiver. This receiver is a device that can accept audio or video input from multiple sources and then send that audio or video to other locations. For surround sound from your PS3, your HDMI cord would connect your PS3 to your AV receiver, which now has both audio and video from your console. That receiver should be connected to your surround-sound speakers and provide your audio. You then connect a second HDMI cord from the receiver to your TV so it has video data to display on its screen, and you can start enjoying HD gaming with surround sound. You may need to adjust specific settings on your receiver or your TV, and you should check the documentation for those devices for details.
PS3 Audio Settings
For the PS3, find the audio configuration options in the "Settings" section of the XMB menu under "Sound Settings," then "Audio Output Settings." Here you should select HDMI as the type of connection you're using. After that, your PS3 will ask you which audio formats it should use. You could simply use the default options for this, but ideally you should check the documentation for your AV receiver. Newer receivers will be compatible with a wide range of formats, but you should look at its specifications to see what it can and cannot accept. The console will then display a review of all your settings, and if you confirm those configurations as correct, you're done setting up the audio.
Other Surround-Sound Setups
If you connect your PS3 directly to your TV, you'll likely only have stereo sound, unless your TV can output sound to an audio receiver or directly to speakers. Your PS3 also supports outputting audio using Toslink through the "Digital Out" port on the back of the unit. This will support up to 5.1 surround sound, and it's an audio-only connection, so you'll need to use HDMI or another connection for the video. If you choose to use the Toslink option, you will need to specify "Digital Out" as the output in the "Audio Output Settings" setup instead of "HDMI."