I'm looking to see if it's possible to find and remove duplicates from the arrays generated below. I've tried array_unique
array_merge
and they haven't worked.
$category = get_the_category();
$tags = wp_get_post_tags($post->ID);
As an example, there is a potential that the word "Apparel" may appear in both Category and Tag for the post. With the "raw" method above, Apparel would appear twice in my output. I'm only looking to include it once. At this point in time, I believe it is ok if both lists are merged and all words are part of 1 output.
Example: %23Apparel %23Auto %23Mens
Then, once the output is generated, I need to add HTML URLEncode %23 to the beginning of each word.
Would appreciate your input.