What is the difference between using $name and $_GET['name'] in PHP?

Using $name directly in PHP can be insecure as it allows user input to be directly accessed and potentially manipulated. It is recommended to use $_GET['name'] instead, which accesses the value of the 'name' parameter from the URL query string in a safer way. This helps prevent security vulnerabilities such as SQL injection and cross-site scripting attacks.

$name = $_GET['name'];
// Use $name in a secure way in your code