eval.in

Paste #4723

PHP — PHP 5.4.6, pasted 1 year ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
<?php

$arr = array();
$arr[0] = array(2628927 => "8250843");
$arr[1] = array(2628927 => "8250843");
$arr[2] = array(2783907 => "8250843");
$arr[3] = array(2783907 => "8250843");
$arr[4] = array(2648250 => "8250843");
$arr[5] = array(2628927 => "8250843");


$del = [2628927 => "8250843"];

unset($arr[array_keys($arr, $del)[0]]);

print_r($arr);

Program Output

Array
(
    [1] => Array
        (
            [2628927] => 8250843
        )

    [2] => Array
        (
            [2783907] => 8250843
        )

    [3] => Array
        (
            [2783907] => 8250843
        )

    [4] => Array
        (
            [2648250] => 8250843
        )

    [5] => Array
        (
            [2628927] => 8250843
        )

)

OK (0.008 sec real, 0.007 sec wall, 13 MB, 264 syscalls)

Fork