tags:

views:

130

answers:

3

For instance

Array(

                [0] => Array
                    (
                        [0] => hello
                        [1] => open
                    )

                [1] => Array
                    (
                        [0] => good
                        [1] => center
                    )

                [2] => Array
                    (
                        [0] => hello
                        [1] => close
                    )
)

i want to delete the element which key is 1, after the operation :

Array(

                [0] => Array
                    (
                        [0] => hello
                        [1] => open
                    )

                [2] => Array
                    (
                        [0] => hello
                        [1] => close
                    )
)

after

+2  A: 

You don't say what language you're using but looking at that output it looks like PHP output (fron print_r()). If so, just use unset():

unset($arr[1]);
cletus
+2  A: 

this looks like PHP to me. I'll delete if it's some other language.

Simply unset($arr[1]);

thephpdeveloper
+2  A: 

PHP

unset($array[1]);
David Kuridža