lug*_*098 2 php variables post
我知道在php中可以使用以下代码:
$dog = 'Woof!';
$cat = 'Miauw!';
$animal = 'dog';
var_dump($$animal);
Run Code Online (Sandbox Code Playgroud)
输出:'Woof!'
当然这是我的实际代码的简化示例,但是你明白了.现在我似乎无法让$_POST
变量以相同的方式运行.
例:
$method = '_POST';
$$method['password'] = array();
// In the end i would want this piece of code above to do what i typed below
$_POST['password'] = array();
Run Code Online (Sandbox Code Playgroud)
输出:'注意:未定义的变量:_POST'
那么这是否意味着不可能以这种方式调用$ _POST,或者我是以错误的方式调用它?
归档时间: |
|
查看次数: |
179 次 |
最近记录: |