我是PHP新手,所以如果这个问题是一个noob,请对不起。我不知道它的名字,所以找不到它。我在这段代码中读到它。这是什么意思?
5号线:${$key}
<?php
$expected = array('carModel', 'year', 'bodyStyle');
foreach($expected AS $key) {
if (!empty($_POST[ $key ])) {
${$key} = $_POST[ $key ];
} else {
${$key} = NULL;
}
}
?>
其实更多的信息,它不是'$ {$'符号,而是一个[变量变量(http://php.net/manual /en/language.variables.variable.php) – 2013-03-21 13:30:04
,它不是“什么”,而是“什么”。 – Alex 2013-03-21 13:36:11