PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
They aren't functions. Not sure why people think that because it's completely wrong.
PHP can see the query string and parses it for $_GET. PHP can also see if there was anything posted to the script and parses that for $_POST. $_REQUEST is generally some combination of $_GET, $_POST, and $_COOKIE.
Exactly how it does that I don't know, and I'm not inclined to check the source code to find out.
The only difference between the first and second bit of code is that the second assumes $_GET['id'] exists. If it doesn't PHP will throw a warning.
Both POST and GET are part of the HTTP protocol. This information is passed over to PHP by the web server when a page is requested.
Read up on HTTP if you are interested, but if not you can just assume that $_POST is always available (even though it may have no values set) and $_GET needs to be checked before you use it.