这里的问题是我有一个包含17个元素的数组。我想获得一段时间所需的元素,然后将它们从阵列中永久删除。
这是代码:
$name = $post['name'];
$email = $post['email'];
$address = $post['address'];
$telephone = $post['telephone'];
$country = $post['country'];
unset($post['name']);
unset($post['email']);
unset($post['address']);
unset($post['telephone']);
unset($post['country']);
是的,代码很丑陋,无需扑朔迷离。如何使它看起来更好?