我写了一些代码:
$params = func_get_args();
$title = $params[1]['title'];
$writer = $params[1]['writer'];
$magname = $params[1]['magname'];
$confname = $params[1]['confname'];
$magyear = $params[1]['magyear'];
$confyear = $params[1]['confyear'];
$subject = $params[1]['subject'];
$scredit = $params[1]['scredit'];
$lang = $params[1]['lang'];
$keywords = $params[1]['keywords'];
$pyear = $params[1]['pyear'];
.....
是否可以使用循环执行此操作?
答案 0 :(得分:3)
这应该这样做:
extract($params[1]);