这数组中怎么删除指定的键

WBOY
Release: 2016-06-23 13:59:43
Original
842 people have browsed it

array (
  'juan_tit' => 
  array (
    0 => '卷一',
    1 => '卷二',
    2 => '卷三',
  ),
)


现在我想删除键名为2的这个值,怎么删除。


回复讨论(解决方案)

$ar = array (  'juan_tit' => array (    0 => '卷一',    1 => '卷二',    2 => '卷三',  ),);unset($ar['juan_tit'][2]);
Copy after login

unset($ar['juan_tit'][2]);

$arr = array(	'juan_tit' => array('卷一','卷二','卷三'));print_r($arr);unset($arr['juan_tit'][2]);print_r($arr);
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template