Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
检索传递给 .php 页面的 GET(在 URL 中)变量的最佳方法是什么
如果您的网址是,exmaple.com/file.php?var=value则“值”存储在$_GET['var']
exmaple.com/file.php?var=value
$_GET['var']
假设您的 GET 请求的形式为page.php?var=1:
page.php?var=1
<?php if (isset($_GET['var'])) { echo $_GET['xyz']; } ?>
但是,如果您使用的是 PHP 框架,它可能会为您提供替代方法。