php - Remove duplicate data based on postID -


i have array follows:

array (     [0] => array         (             [postid] => 105             [posttitle] => test             [postnonarray] => subzero             [postdesc] => array                 (                     [0] => array                         (                             [para] => subzero                             [align] => l                         )                  )              [postdate] => 25.08.2016             [posttime] => 13:44             [postimage] => http://testyourprojects.biz/custom/ci/tharjumal/uploads/post/post_1472112857.png             [postvideo] =>          )      [1] => array         (             [postid] => 106             [posttitle] => test 2             [postnonarray] => test             [postdesc] => array                 (                     [0] => array                         (                             [para] => test                             [align] => l                         )                  )              [postdate] => 26.08.2016             [posttime] => 18:08             [postimage] => http://testyourprojects.biz/custom/ci/tharjumal/uploads/post/post_1472215085.jpg             [postvideo] =>          )      [2] => array         (             [postid] => 106             [posttitle] => test 2             [postnonarray] => test             [postdesc] => array                 (                     [0] => array                         (                             [para] => test                             [align] => l                         )                  )              [postdate] => 26.08.2016             [posttime] => 18:08             [postimage] => http://testyourprojects.biz/custom/ci/tharjumal/uploads/post/post_1472215085.jpg             [postvideo] =>          )  ) 

as can see, there 2 post details postid=106; how can remove redundant data array based on postid?

the project on php.

i think trying achieve:-

$array = array_map("unserialize", array_unique(array_map("serialize", $array))); echo "<pre/>";print_r($array); 

check output(whole code original array):- https://eval.in/630678

note:- remove duplicate values (so whole duplicate array gone asked in comment)


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -