Ok, Basically I am trying to create a unique list of Tags names from a database.
The database has a 'Tags' column but the value in the column can have multiple values pre record separated by a comma like...
life, book, report ...
I am pulling the data with
$allTags = mysql_query("SELECT Tags FROM study_reference")
I need to cycle through each record...
while($tags=mysql_fetch_array($allTags)) {
}
..and split each string into individual words.
Currently I'm using to do this..
$words = preg_split('/[^a-zA-Z\'"-]+/', $tag, -1, PREG_SPLIT_NO_EMPTY);
The problem I'm having is, when it moves to the next record it replaces the $words array.
How can I achieve what I want?
Hope I've explained myself clearly enough!
The database has a 'Tags' column but the value in the column can have multiple values pre record separated by a comma like...
life, book, report ...
I am pulling the data with
$allTags = mysql_query("SELECT Tags FROM study_reference")
I need to cycle through each record...
while($tags=mysql_fetch_array($allTags)) {
}
..and split each string into individual words.
Currently I'm using to do this..
$words = preg_split('/[^a-zA-Z\'"-]+/', $tag, -1, PREG_SPLIT_NO_EMPTY);
The problem I'm having is, when it moves to the next record it replaces the $words array.
How can I achieve what I want?
Hope I've explained myself clearly enough!