📜  在 PHP 代码示例中从数组中删除元素

📅  最后修改于: 2022-03-11 14:54:26.501000             🧑  作者: Mango

代码示例4
$arr = array('a' => 1, 'b' => 2, 'c' => 3);
unset($arr['b']);

// RESULT: array('a' => 1, 'c' => 3)

$arr = array(1, 2, 3);
array_splice($arr, 1, 1);

// RESULT: array(0 => 1, 1 => 3)