eval.in

Paste #30731

PHP — PHP 5.4.6, pasted 11 months ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
<?php
$array = Array(
		Array(
				"subtitle" => Array(
						0 => "this field is required",
						1 => "must be longer than2"
				)
		),
		Array(
				"subtitle" => Array(
						0 => "this field is required",
						1 => "must be longer than2"
				)
		)
);

$unique = array_map("unserialize", array_unique(array_map("serialize", $array)));
print_r($unique);

?>

Program Output

Array
(
    [0] => Array
        (
            [subtitle] => Array
                (
                    [0] => this field is required
                    [1] => must be longer than2
                )

        )

)

OK (0.008 sec real, 0.030 sec wall, 13 MB, 172 syscalls)

Fork