Home >Backend Development >PHP Tutorial >PHP $_GET
PHP $_GET can also be used to collect form data after submitting an HTML form (method="get").
$_GET can also collect data sent in the URL.
Suppose we have a page containing hyperlinks with parameters:
<html> <body> <a href="test_get.php?subject=PHP&web=W3school.com.cn">测试 $GET</a> </body> </html> 当用户点击链接 "Test $GET",参数 "subject" 和 "web" 被发送到 "test_get.php",然后您就能够通过 $_GET 在 "test_get.php" 中访问这些值了。 下面的例子是 "test_get.php" 中的代码: 实例 <html> <body> <?php echo "Study " . $_GET['subject'] . " at " . $_GET['web']; ?> </body> </html>