The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Need Help with An Array
I have an array that looks kind of like this:
$array = array("rss", "rss, happy, total", "total, happy, yesterday"); Now what I'd like to do is remove all of the duplicates so I have one array that looks like this - just one element in each value. $array = array("rss", "happy", "total", "yesterday"); How could I do this? |
#2
|
||||
|
||||
PHP Code:
|
#3
|
|||
|
|||
Yeah, but how do I get that first array?
It's already set as: $array = array("rss", "rss, happy, total", "total, happy, yesterday"); That's in the database already, I can't just change it -- well, my question is, how do I change it to a way I can use array_unique. |
#4
|
||||
|
||||
PHP Code:
|
#5
|
|||
|
|||
Tried it and still had duplicates. Am I missing something?
:-/ Thanks for your help by the way! PHP Code:
|
#6
|
||||
|
||||
Can you give me the value of "$entry['tags']"?
|
#7
|
|||
|
|||
Maybe I'm making a mistake -- so here's the output (value of $entry['tags']) from the query I am running.
Thanks again. |
#8
|
||||
|
||||
PHP Code:
|
#9
|
|||
|
|||
Hmm, this only returned three results:
recommendation, avatar, ap related --------------- Added [DATE]1209324149[/DATE] at [TIME]1209324149[/TIME] --------------- However, removing "$tags = array_map('trim', $tag_entry);" seems to have done it. --------------- Added [DATE]1209325454[/DATE] at [TIME]1209325454[/TIME] --------------- Of course - sort() doesn't work on this -- but it seems to work for what I need! Thank you so much!!! I appreciate it. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|