我想要一个文件,但也通过 url 传递 GET 变量,但是当我写:
I would like to require a file but also pass GET variables through the url, but when I write:
<?php
require_once("myfile.php?name=savagewood");
?>
我收到一个致命错误.我将如何以不同的方式完成此功能,以免出现致命错误?
I get a fatal error. How would I accomplish this functionality in a different way, such that I don't get a fatal error?
变量将正常可用,您不必像这样传递.
variables will be available as normal you do not have to pass like this.
$name='savagewood';
require_once("myfile.php");
$name
将在 myfile.php
这篇关于PHP 需要并包含 GET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!