Ec (2); we use the unset function to delete the specified array subscript element. Next, let's look at the unset syntax voidunset (mixedvar [, mixedvar [,...]). unset () destroys the specified variable. Note that in php tutorial 3, unset () will return true (actually an integer value of 1 & nbsp; $ arrayarray (1 & gt; 1, 2 & gt; 2, 3 & gt script ec (2); script
The unset function is used to delete the subscript element of a specified array. Next, let's look at the unset syntax.
Void unset (mixed var [, mixed var [,...])
Unset () destroys the specified variable. Note that in php tutorial 3, unset () returns true (actually an integer value of 1 ).
$ Array = array (1 => '1', 2 => '2', 3 => '3', 4 => '5 ', 5 => '6 ');
Print_r ($ array );
Array
(
[1] => 1
[2] => 2
[3] => 3
[4] => 5
[5] => 6
)
Unset ($ array [2]);
Print_r ($ array );
Array
(
[1] => 1
[3] => 3
[4] => 5
[5] => 6
)
Site original, reprinted with the source of http://www.111cn.net otherwise will be investigated