<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<?php
class Action{
public function __call($name,$argument){
echo $name.'天气预报';
}
}
$action=new Action();
$method=$_GET['method'];
if ($method) {
$action->$method();
}
$_GET 变量是一个数组,内容是由 HTTP GET 方法发送的变量名称和值。
(请注意,表单域的名称会自动成为 $_GET 数组中的 ID 键)
为什么使用 $_GET?
注释:在使用 $_GET 变量时,所有的变量名和值都会显示在 URL 中。所以在发送密码或其他敏感信息时,不应该使用这个方法。不过,正因为变量显示在 URL 中,因此可以在收藏夹中收藏该页面。在某些情况下,这是很有用的。