Array Unique in two dimentional array in PHP
Posted
by Kaiser
on Stack Overflow
See other posts from Stack Overflow
or by Kaiser
Published on 2010-03-25T21:12:06Z
Indexed on
2010/03/25
21:13 UTC
Read the original article
Hit count: 530
Hi I have an array that looks like this :
Array ( [0] => Array ( [x] => 01 [y] => 244 ) [1] => Array ( [x] => 02 [y] => 244 ) [2] => Array ( [x] => 03 [y] => 244 ) [3] => Array ( [x] => 04 [y] => 243 ) [4] => Array ( [x] => 05 [y] => 243 ) [5] => Array ( [x] => 05 [y] => 244 ) [6] => Array ( [x] => 06 [y] => 242 ) [7] => Array ( [x] => 06 [y] => 243 ) [8] => Array ( [x] => 07 [y] => 243 ) [9] => Array ( [x] => 08 [y] => 243 ) [10] => Array ( [x] => 09 [y] => 242 ) [11] => Array ( [x] => 10 [y] => 244 ) [12] => Array ( [x] => 12 [y] => 243 ) [13] => Array ( [x] => 13 [y] => 243 ) [14] => Array ( [x] => 13 [y] => 243 ) [15] => Array ( [x] => 15 [y] => 243 ) )
x represent days and y values of a certain variable. I would like to display an array of unique days x ( last element ) and values y pragmatically.
for example day 6 I have two y values but I want to display only the last one ( 243 ).
Thanks for help
© Stack Overflow or respective owner