相关疑难解决方法(0)

更好地取消设置多个数组元素的方法

这里的交易是我有一个包含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']);
Run Code Online (Sandbox Code Playgroud)

是的,代码很难看,不需要打击.如何让这个看起来更好?

php

72
推荐指数
3
解决办法
6万
查看次数

标签 统计

php ×1