I would like to remove duplicate array from multi dimension array
following is my code
$getResult = $wpdb->get_results("SELECT *FROM `".$wpdb->prefix."flyusers` WHERE user_id=$userid ORDER BY id");
if(isset($getResult) && !empty($getResult)){
foreach($getResult as $key=>$val){
$getStorePosts = get_posts($args);
$postTitle = array_column($getStorePosts, 'post_title','ID');
$main = array();
foreach ($getStorePosts as $key => $value) {
$id =$value->ID;
$titlesOfProduct[$id]= $value->post_title;
}
echo "<pre>";
print_r ($titlesOfProduct);
echo "</pre>";
}
}
It's showing following output.
<pre>
Array
(
[665] => Royal Wulff size 8
[13] => Royal Wulff
)
</pre>
<pre>
Array
(
[665] => Royal Wulff size 8
[13] => Royal Wulff
[128] => Blue Wing Olive (BWO) Nymph
)
</pre>
But i want only this output
<pre>
Array
(
[665] => Royal Wulff size 8
[13] => Royal Wulff
[128] => Blue Wing Olive (BWO) Nymph
)
</pre>
Some one pleas help me on this.