$input=new Input();
$upSet=$input->post();
var_dump($upSet);
class Input{
function post($key){
if(isset($_POST[$key])){
$val=$_POST[$key];
return $val;
}
}
报错
Warning: Missing argument 1 for Input::post(),
Notice: Undefined variable: key
Solution:
function post($key = 'default'){}
Write less closing curly braces below the Input class }
In addition, there are no parameters passed in the post method