By Ben


2008-12-15 20:28:55 8 Comments

Is there an easy way to delete an element from an array using PHP, such that foreach ($array) no longer includes that element?

I thought that setting it to null would do it, but apparently it does not work.

30 comments

@Konrad Rudolph 2008-12-15 20:30:46

There are different ways to delete an array element, where some are more useful for some specific tasks than others.

Delete one array element

If you want to delete just one array element you can use unset() or alternatively \array_splice().

Also if you have the value and don't know the key to delete the element you can use \array_search() to get the key.

unset()

Note that when you use unset() the array keys won't change/reindex. If you want to reindex the keys you can use \array_values() after unset() which will convert all keys to numerical enumerated keys starting from 0.

Code

<?php

    $array = [0 => "a", 1 => "b", 2 => "c"];
    unset($array[1]);
                //↑ Key which you want to delete

?>

Output

[
    [0] => a
    [2] => c
]

\array_splice() method

If you use \array_splice() the keys will be automatically reindexed, but the associative keys won't change as opposed to \array_values() which will convert all keys to numerical keys.

Also \array_splice() needs the offset, not the key! as the second parameter.

Code

<?php

    $array = [0 => "a", 1 => "b", 2 => "c"];
    \array_splice($array, 1, 1);
                        //↑ Offset which you want to delete

?>

Output

[
    [0] => a
    [1] => c
]

array_splice() same as unset() take the array by reference, and this means you don't want to assign the return values of those functions back to the array.

Delete multiple array elements

If you want to delete multiple array elements and don't want to call unset() or \array_splice() multiple times you can use the functions \array_diff() or \array_diff_key() depending on if you know the values or the keys of the elements which you want to delete.

\array_diff() method

If you know the values of the array elements which you want to delete, then you can use \array_diff(). As before with unset() it won't change/reindex the keys of the array.

Code

<?php

    $array = [0 => "a", 1 => "b", 2 => "c"];
    $array = \array_diff($array, ["a", "c"]);
                               //└────────┘→ Array values which you want to delete

?>

Output

[
    [1] => b
]

\array_diff_key() method

If you know the keys of the elements which you want to delete, then you want to use \array_diff_key(). Here you have to make sure you pass the keys as keys in the second parameter and not as values. Otherwise, you have to flip the array with \array_flip(). And also here the keys won't change/reindex.

Code

<?php

    $array = [0 => "a", 1 => "b", 2 => "c"];
    $array = \array_diff_key($array, [0 => "xy", "2" => "xy"]);
                                    //↑           ↑ Array keys which you want to delete
?>

Output

[
    [1] => b
]

Also if you want to use unset() or \array_splice() to delete multiple elements with the same value you can use \array_keys() to get all the keys for a specific value and then delete all elements.

@Alexandru R 2012-06-13 12:23:11

if you have <?php $x = array(1, 2, 3, 4); unset($x[2]); var_dump($x); // array(3) { [0]=> int(0), [1]=> int(2), [3]=> int(4), } ?>

@Konrad Rudolph 2012-06-13 12:26:44

@AlexandruRada No, you said “don’t use this” – and that’s just nonsense. You can safely use this method when you treat an array as what it is – a dictionary. Only if you are expecting consecutive numeric indices do you need to use something else.

@Konrad Rudolph 2013-11-30 11:21:12

@Alexander Use array_splice, as described in the other answers.

@inemanja 2016-04-19 05:33:11

@AlexandruRada There is no way you can have array (3) { [0]=>int(0) ... when you unset($x[2]) from $x = array(1, 2, 3, 4); Result must be var_dump($x); // array(3) { [0]=> int(1) [1]=> int(2) [3]=> int(4) } (it was probably typo)

@Константин Ван 2017-04-14 03:12:44

unset can have multiple arguments: void unset ( mixed $var [, mixed $... ] ).

@dotnetCarpenter 2017-05-06 00:20:39

array_filter is also a viable method. Especially good if you don't want to mutate the array but it also doesn't reindex which can be an issue with json_encode. php.net/manual/en/function.json-encode.php#94157

@Nabi K.A.Z. 2018-10-16 01:23:13

In array_splice and another codes, must know key or values name of array, and so some time reindex key array, for remove first item with keep order of index and if don't know index item, can use this method: stackoverflow.com/a/52826684/1407491

@Kuldeep singh 2019-07-11 06:27:42

Is there is any way to delete array element from multi dimensional (key, value) array .

@Moisés Márquez 2019-07-23 15:47:53

For delete multiple elements or check in multi dimensional arrays, array_map can be an useful addition.

@hvertous 2019-12-03 14:19:26

unset is not a function but a language construct (and a keyword). It must not and cannot be prefixed with ``

@Konrad Rudolph 2019-12-03 14:45:32

@hvertous Thanks, well spotted! Corrected it now.

@Ahmad Mobaraki 2019-05-23 12:26:29

If index is specified:

$arr = ['a', 'b', 'c'];
$index = 0;

unset($arr[$index]);  // result: $arr = ['b', 'c']

If index is NOT specified:

$arr = ['a', 'b', 'c'];
$index = array_search('a',$arr); // search the value to find index

unset($arr[$index]);  // result: $arr = ['b', 'c']

@Saurabh Chandra Patel 2013-06-11 05:51:47

<?php
    $stack = ["fruit1", "fruit2", "fruit3", "fruit4"];
    $fruit = array_shift($stack);
    print_r($stack);

    echo $fruit;
?>

Output:

[
    [0] => fruit2
    [1] => fruit3
    [2] => fruit4
]

fruit1

@Jasir 2014-07-22 17:22:09

Note that array_shift can only delete the first element in the array. similarly use array_pop to delete the last element in the array.

@sweisgerber.dev 2014-10-14 11:03:24

Answer is only applicable to the first element of an array and does not answer the general question.

@Saurabh Chandra Patel 2014-10-14 12:13:06

@sebweisgerber you are right but i don't think that is wrong ans and need to downvote this ans . Question is delete an element not mention any position.

@Wakar Ahmad Khan 2018-03-21 06:48:02

$x = array(1, 2, 3, 4, 5);
var_dump($x);
unset($x[3]); // Here is the key to be deleted
echo '<br>';
array_values($x);
var_dump($x);

@Ian Y. 2019-11-23 10:51:29

The fifth line is supposed to be $x = array_values($x);.

@Premjith 2018-03-21 09:06:24

You can use the array_pop method to remove the last element of an array:

<?php
    $a = array("one", "two", "Three");
    array_pop($a);
    print_r($a);
?>
The out put will be
Array ( [0] => one[1] => two)

which deletes only last element of an array LIFO operation

@Sam Tigle 2019-06-11 10:16:46

if you want to remove a specific object of an array by reference of that object you can do following:

unset($array[array_search($object,$array)]);

Example:

<?php
class Foo
{
    public $id;
    public $name;
}

$foo1 = new Foo();
$foo1->id = 1;
$foo1->name = 'Name1';

$foo2 = new Foo();
$foo2->id = 2;
$foo2->name = 'Name2';

$foo3 = new Foo();
$foo3->id = 3;
$foo3->name = 'Name3';


$array = array($foo1,$foo2,$foo3);
unset($array[array_search($foo2,$array)]);

echo '<pre>';
var_dump($array);
echo '</pre>';
?>

Result:

array(2) {
[0]=>
    object(Foo)#1 (2) {
        ["id"]=>
        int(1)
        ["name"]=>
        string(5) "Name1"
    }
[2]=>
    object(Foo)#3 (2) {
        ["id"]=>
        int(3)
        ["name"]=>
        string(5) "Name3"
    }
}

Note that if the object occures several times it will only be removed the first occurence!

@Javed Khan 2019-05-29 05:09:59

$arrayName = array( '1' => 'somevalue',
                    '2' => 'somevalue1',
                    '3' => 'somevalue3',
                  );

print_r($arrayName[1]);
// somevalue
unset($arrayName[1]);

print_r($arrayName);

@user8031209 2019-02-24 11:19:25

Use array_search to get the key and remove it with unset if found:

if (($key = array_search('word', $array)) !== false) {
    unset($array[$key]);
}

@Nabi K.A.Z. 2018-10-16 01:20:57

Two ways for removing the first item of an array with keeping order of the index and also if you don't know the key name of the first item.

Solution #1

// 1 is the index of the first object to get
// NULL to get everything until the end
// true to preserve keys
$array = array_slice($array, 1, null, true);

Solution #2

// Rewinds the array's internal pointer to the first element
// and returns the value of the first array element.
$value = reset($array);
// Returns the index element of the current array position
$key = key($array);
unset($array[$key]);

For this sample data:

$array = array(10 => "a", 20 => "b", 30 => "c");

You must have this result:

array(2) {
  [20]=>
  string(1) "b"
  [30]=>
  string(1) "c"
}

@Rahul Patel 2018-04-27 08:23:13

For associative arrays, with non-integer keys:

Simply, unset($array[$key]) would work.

For arrays having integer keys and if you want to maintain your keys:

  1. $array = [ 'mango', 'red', 'orange', 'grapes'];

    unset($array[2]);
    $array = array_values($array);
    
  2. array_splice($array, 2, 1);

@Mohammad Wasim 2018-04-24 09:28:44

There are two methods to do this task: unset() and array_splice()

Let us assume two arrays:

$array_1 = array('a'=>'One', 'b'=>'Two', 'c'=>'Three');

$array_2 = array('Red', 'Yellow', 'White', 'Black', 'Green');

With unset()

syntax - unset(array_element)

unset($array_1['a']); // Any valid key
unset($array_2[0]); // Any valid index
  • after removing an array element, the array index does not change

With array_splice()

syntax - array_splice(array, index, length)

array_splice($array_1, 1, 1); // Remove one element from $array_1 from index 1
array_splice($array_2, 3, 1); // Remove one element from $array_2 from index 3
  • All array elements are reindexed after removing an element from the array

@inrsaurabh 2018-03-10 15:05:55

unset doesn't change the index, but array_splice does:

$arrayName = array('1' => 'somevalue',
                   '2' => 'somevalue1',
                   '3' => 'somevalue3',
                   500 => 'somevalue500',
                  );


    echo $arrayName['500'];
    //somevalue500
    array_splice($arrayName, 1, 2);

    print_r($arrayName);
    //Array ( [0] => somevalue [1] => somevalue500 )


    $arrayName = array( '1' => 'somevalue',
                        '2' => 'somevalue1',
                        '3' => 'somevalue3',
                        500 => 'somevalue500',
                      );


    echo $arrayName['500'];
    //somevalue500
    unset($arrayName[1]);

    print_r($arrayName);
    //Array ( [0] => somevalue [1] => somevalue500 )

@Star 2018-01-29 11:08:20

Solutions:

  1. To delete one element, use unset():
unset($array[3]);
unset($array['foo']);
  1. To delete multiple noncontiguous elements, also use unset():
unset($array[3], $array[5]);
unset($array['foo'], $array['bar']);
  1. To delete multiple contiguous elements, use array_splice():
array_splice($array, $offset, $length);

Further explanation:

Using these functions removes all references to these elements from PHP. If you want to keep a key in the array, but with an empty value, assign the empty string to the element:

$array[3] = $array['foo'] = '';

Besides syntax, there's a logical difference between using unset() and assigning '' to the element. The first says This doesn't exist anymore, while the second says This still exists, but its value is the empty string.

If you're dealing with numbers, assigning 0 may be a better alternative. So, if a company stopped production of the model XL1000 sprocket, it would update its inventory with:

unset($products['XL1000']);

However, if it temporarily ran out of XL1000 sprockets, but was planning to receive a new shipment from the plant later this week, this is better:

$products['XL1000'] = 0;

If you unset() an element, PHP adjusts the array so that looping still works correctly. It doesn't compact the array to fill in the missing holes. This is what we mean when we say that all arrays are associative, even when they appear to be numeric. Here's an example:

// Create a "numeric" array
$animals = array('ant', 'bee', 'cat', 'dog', 'elk', 'fox');
print $animals[1];  // Prints 'bee'
print $animals[2];  // Prints 'cat'
count($animals);    // Returns 6

// unset()
unset($animals[1]); // Removes element $animals[1] = 'bee'
print $animals[1];  // Prints '' and throws an E_NOTICE error
print $animals[2];  // Still prints 'cat'
count($animals);    // Returns 5, even though $array[5] is 'fox'

// Add a new element
$animals[ ] = 'gnu'; // Add a new element (not Unix)
print $animals[1];  // Prints '', still empty
print $animals[6];  // Prints 'gnu', this is where 'gnu' ended up
count($animals);    // Returns 6

// Assign ''
$animals[2] = '';   // Zero out value
print $animals[2];  // Prints ''
count($animals);    // Returns 6, count does not decrease

To compact the array into a densely filled numeric array, use array_values():

$animals = array_values($animals);

Alternatively, array_splice() automatically reindexes arrays to avoid leaving holes:

// Create a "numeric" array
$animals = array('ant', 'bee', 'cat', 'dog', 'elk', 'fox');
array_splice($animals, 2, 2);
print_r($animals);
Array
(
    [0] => ant
    [1] => bee
    [2] => elk
    [3] => fox
)

This is useful if you're using the array as a queue and want to remove items from the queue while still allowing random access. To safely remove the first or last element from an array, use array_shift() and array_pop(), respectively.

@Joshua Charles Pickwell 2017-11-23 08:17:53

<?php
    $array = array("your array");
    $array = array_diff($array, ["element you want to delete"]);
?>

Create your array in the variable $array and then where I have put 'element you want to delete' you put something like: "a". And if you want to delete multiple items then: "a", "b".

@Drake Boein 2017-10-30 17:12:53

You can simply use unset() to delete an array.

Remember that an array must be unset after the foreach function.

@MahdiY 2017-09-22 10:28:59

Remove an array element based on a key:

Use the unset function like below:

$a = array(
       'salam',
       '10',
       1
);

unset($a[1]);

print_r($a);

/*

    Output:

        Array
        (
            [0] => salam
            [2] => 1
        )

*/

Remove an array element based on value:

Use the array_search function to get an element key and use the above manner to remove an array element like below:

$a = array(
       'salam',
       '10',
       1
);

$key = array_search(10, $a);

if ($key !== false) {
    unset($a[$key]);
}

print_r($a);

/*

    Output:

        Array
        (
            [0] => salam
            [2] => 1
        )

*/

@SparK 2017-06-23 14:48:30

For those of you who are looking for Ruby's hash#delete equivalent in PHP:

<?php
    function array_delete(&$array, $key) {
        if (!isset($array[$key])) {
            return null;
        }

        $value = $array[$key];
        unset($array[$key]);
        return $value;
    }

This will not only delete the element from your array, but it will also return the value stored in that key so you can consume your array in a non-linear fashion.

@SparK 2019-02-22 16:01:34

Added this because this was how I got here from google

@SparK 2019-05-13 14:52:12

Even though it's downvoted a lot I will keep it here, because it's important for a minority in the community.

@Klajdi Dosti 2016-09-15 15:18:02

This may help...

<?php
    $a1 = array("a"=>"red", "b"=>"green", "c"=>"blue", "d"=>"yellow");
    $a2 = array("a"=>"purple", "b"=>"orange");
    array_splice($a1, 0, 2, $a2);
    print_r($a1);
?>

The result will be:

Array ( [0] => purple [1] => orange [c] => blue [d] => yellow )

@UMAR FAROOQUE KHAN 2016-08-16 15:36:02

<?php
    // If you want to remove a particular array element use this method
    $my_array = array("key1"=>"value 1", "key2"=>"value 2", "key3"=>"value 3");

    print_r($my_array);
    if (array_key_exists("key1", $my_array)) {
        unset($my_array['key1']);
        print_r($my_array);
    }
    else {
        echo "Key does not exist";
    }
?>

<?php
    //To remove first array element
    $my_array = array("key1"=>"value 1", "key2"=>"value 2", "key3"=>"value 3");
    print_r($my_array);
    $new_array = array_slice($my_array, 1);
    print_r($new_array);
?>


<?php
    echo "<br/>    ";
    // To remove first array element to length
    // starts from first and remove two element
    $my_array = array("key1"=>"value 1", "key2"=>"value 2", "key3"=>"value 3");
    print_r($my_array);
    $new_array = array_slice($my_array, 1, 2);
    print_r($new_array);
?>

Output

 Array ( [key1] => value 1 [key2] => value 2 [key3] =>
 value 3 ) Array (    [key2] => value 2 [key3] => value 3 )
 Array ( [key1] => value 1 [key2] => value 2 [key3] => value 3 )
 Array ( [key2] => value 2 [key3] => value 3 )
 Array ( [key1] => value 1 [key2] => value 2 [key3] => value 3 )
 Array ( [key2] => value 2 [key3] => value 3 )

@John Slegers 2016-03-11 18:48:25

Associative arrays

For associative arrays, use unset:

$arr = array('a' => 1, 'b' => 2, 'c' => 3);
unset($arr['b']);

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

Numeric arrays

For numeric arrays, use array_splice:

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

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

Note

Using unset for numeric arrays will not produce an error, but it will mess up your indexes:

$arr = array(1, 2, 3);
unset($arr[1]);

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

@msvairam 2016-01-25 13:07:09

Follow the default functions:

i)

$Array = array("test1", "test2", "test3", "test3");

unset($Array[2]);

ii)

$Array = array("test1", "test2", "test3", "test3");

array_pop($Array);

iii)

$Array = array("test1", "test2", "test3", "test3");

array_splice($Array,1,2);

iv)

$Array = array("test1", "test2", "test3", "test3");

array_shift($Array);

@Oxydel 2013-08-21 02:31:03

I'd just like to say I had a particular object that had variable attributes (it was basically mapping a table and I was changing the columns in the table, so the attributes in the object, reflecting the table would vary as well):

class obj {
    protected $fields = array('field1','field2');
    protected $field1 = array();
    protected $field2 = array();
    protected loadfields(){}
    // This will load the $field1 and $field2 with rows of data for the column they describe
    protected function clearFields($num){
        foreach($fields as $field) {
            unset($this->$field[$num]);
            // This did not work the line below worked
            unset($this->{$field}[$num]); // You have to resolve $field first using {}
        }
    }
}

The whole purpose of $fields was just, so I don't have to look everywhere in the code when they're changed, I just look at the beginning of the class and change the list of attributes and the $fields array content to reflect the new attributes.

@Ankit Aggarwal 2013-07-26 20:11:54

unset() destroys the specified variables.

The behavior of unset() inside of a function can vary depending on what type of variable you are attempting to destroy.

If a globalized variable is unset() inside of a function, only the local variable is destroyed. The variable in the calling environment will retain the same value as before unset() was called.

<?php
    function destroy_foo()
    {
        global $foo;
        unset($foo);
    }

    $foo = 'bar';
    destroy_foo();
    echo $foo;
?>

The answer of the above code will be bar.

To unset() a global variable inside of a function:

<?php
    function foo()
    {
        unset($GLOBALS['bar']);
    }

    $bar = "something";
    foo();
?>

@Sunil Kumar Sain 2013-05-17 08:56:09

Use the following code:

$arr = array('orange', 'banana', 'apple', 'raspberry');
$result = array_pop($arr);
print_r($result);

@Chris K 2014-09-16 00:33:10

php5: simply running array_pop($arr) removes the final entry. No ` = ` needed.

@liamvictor 2011-11-15 11:29:01

$key = array_search($needle, $array);
if ($key !== false) {
    unset($array[$key]);
}

@ToolmakerSteve 2016-09-24 18:09:08

Would be good to clarify that this answer is for deleting an element, when you know the value, but not the key. Note that it only deletes the FIRST instance of the value; to find all keys for a value, use array_keys

@Marcel Cozma 2011-08-02 15:57:47

  // Our initial array
  $arr = array("blue", "green", "red", "yellow", "green", "orange", "yellow", "indigo", "red");
  print_r($arr);

  // Remove the elements who's values are yellow or red
  $arr = array_diff($arr, array("yellow", "red"));
  print_r($arr);

This is the output from the code above:

Array
(
    [0] => blue
    [1] => green
    [2] => red
    [3] => yellow
    [4] => green
    [5] => orange
    [6] => yellow
    [7] => indigo
    [8] => red
)

Array
(
    [0] => blue
    [1] => green
    [4] => green
    [5] => orange
    [7] => indigo
)

Now, array_values() will reindex a numerical array nicely, but it will remove all key strings from the array and replace them with numbers. If you need to preserve the key names (strings), or reindex the array if all keys are numerical, use array_merge():

$arr = array_merge(array_diff($arr, array("yellow", "red")));
print_r($arr);

Outputs

Array
(
    [0] => blue
    [1] => green
    [2] => green
    [3] => orange
    [4] => indigo
)

@heart hacker 2018-09-20 05:56:06

$get_merged_values = array_merge($data['res'],$data['check_res']); when i print this print_r($get_merged_values); it displays the following. Array ( [0] => Array ( [menu_code] => 2 [menu_name] => Plant [menu_order_no] => 1 ) [1] => Array ( [menu_code] => 3 [menu_name] => Line [menu_order_no] => 2 ) ) But i need to get the values of menu_code and menu_name using $get_merged_values['menu_code'] and $get_merged_values['menu_name'] respectively, instead of using $get_merged_values[0][menu_code], $get_merged_values[0][menu_name]. please help me how to do this?

@Tebe 2015-06-11 22:25:32

Suppose you have the following array:

Array
(
    [user_id] => 193
    [storage] => 5
)

To delete storage, do:

unset($attributes['storage']);
$attributes = array_filter($attributes);

And you get:

Array
(
    [user_id] => 193
)

@David 2017-03-17 14:38:56

What is array_filter used for?

@Tebe 2017-06-26 12:13:13

to remove falsy elements

@Kristoffer Bohmann 2017-12-07 06:28:59

unset() multiple, fragmented elements from an array

While unset() has been mentioned here several times, it has yet to be mentioned that unset() accepts multiple variables making it easy to delete multiple, noncontiguous elements from an array in one operation:

// Delete multiple, noncontiguous elements from an array
$array = [ 'foo', 'bar', 'baz', 'quz' ];
unset( $array[2], $array[3] );
print_r($array);
// Output: [ 'foo', 'bar' ]

unset() dynamically

unset() does not accept an array of keys to remove, so the code below will fail (it would have made it slightly easier to use unset() dynamically though).

$array = range(0,5);
$remove = [1,2];
$array = unset( $remove ); // FAILS: "unexpected 'unset'"
print_r($array);

Instead, unset() can be used dynamically in a foreach loop:

$array = range(0,5);
$remove = [1,2];
foreach ($remove as $k=>$v) {
    unset($array[$v]);
}
print_r($array);
// Output: [ 0, 3, 4, 5 ]

Remove array keys by copying the array

There is also another practice that has yet to be mentioned. Sometimes, the simplest way to get rid of certain array keys is to simply copy $array1 into $array2.

$array1 = range(1,10);
foreach ($array1 as $v) {
    // Remove all even integers from the array
    if( $v % 2 ) {
        $array2[] = $v;
    }
}
print_r($array2);
// Output: [ 1, 3, 5, 7, 9 ];

Obviously, the same practice applies to text strings:

$array1 = [ 'foo', '_bar', 'baz' ];
foreach ($array1 as $v) {
    // Remove all strings beginning with underscore
    if( strpos($v,'_')===false ) {
        $array2[] = $v;
    }
}
print_r($array2);
// Output: [ 'foo', 'baz' ]

@DefenestrationDay 2010-07-31 01:06:55

Also, for a named element:

unset($array["elementName"]);

@DefenestrationDay 2011-06-09 01:50:49

$a = array("A"=>1, "B"=>2, "C"=>"a"); print_r($a); unset($a["B"]); print_r($a); gives (formatted): Array ( [A] => 1 [B] => 2 [C] => a ), Array ( [A] => 1 [C] => a )

@carpii 2012-04-06 00:29:58

It seems you cannot unset array elements indexed by a string (generates "Fatal error: Cannot unset string offsets"). I dont think this was always the case, but certainly as of PHP 5.3.10 and probably earlier

@Jimbo 2013-03-20 09:56:35

@carpii PHP can unset elements from an associative array. The fatal error is caused when you try to use unset($var['key']) on a string instead of an array For example: $array = array( 'test' => 'value', 'another' => 'value', ); unset($array['test']); // Removes the "test" element from the array as expected $array = 'test'; unset($array['test']); // Throws "Fatal error: Cannot unset string offsets" as expected

@Nabi K.A.Z. 2018-10-16 01:23:59

Here you must know the key name, it's better: stackoverflow.com/a/52826684/1407491

@GigolNet Guigolachvili 2016-04-02 18:42:29

// Remove by value
function removeFromArr($arr, $val)
{
    unset($arr[array_search($val, $arr)]);
    return array_values($arr);
}

Related Questions

Sponsored Content

34 Answered Questions

[SOLVED] Create ArrayList from array

88 Answered Questions

[SOLVED] How do I remove a particular element from an array in JavaScript?

  • 2011-04-23 22:17:18
  • Walker
  • 6150898 View
  • 7677 Score
  • 88 Answer
  • Tags:   javascript arrays

18 Answered Questions

[SOLVED] Reference — What does this symbol mean in PHP?

47 Answered Questions

13 Answered Questions

[SOLVED] How can I add new array elements at the beginning of an array in Javascript?

  • 2011-11-10 00:35:22
  • Moon
  • 748010 View
  • 1480 Score
  • 13 Answer
  • Tags:   javascript arrays

26 Answered Questions

[SOLVED] Deleting array elements in JavaScript - delete vs splice

33 Answered Questions

[SOLVED] For-each over an array in JavaScript?

7 Answered Questions

[SOLVED] How does PHP 'foreach' actually work?

36 Answered Questions

[SOLVED] PHP and Enumerations

  • 2008-10-31 18:51:14
  • Henrik Paul
  • 466936 View
  • 1114 Score
  • 36 Answer
  • Tags:   php enumeration

19 Answered Questions

[SOLVED] Get first key in a (possibly) associative array?

  • 2009-06-22 18:13:59
  • Alex S
  • 554564 View
  • 731 Score
  • 19 Answer
  • Tags:   php arrays

Sponsored Content