split array values when there is a comma

n4444b

New Member
hi i'm able to split a string into an array\[code\]$array = preg_split("/[\s]*[,][\s]*/", $category); RESULT Array ( [0] => jquery[1] => bla[2] => bla);\[/code\]but now i have a database with a row holding all by categories ("cat1, 2, 3, ..") - multiple records have similar categories- so in order to create a quick "category" menu i'm using this code this code:\[code\] while ($row = mysql_fetch_array($result,MYSQL_ASSOC)){ $category[] = $row[category];} $array = array_unique($category);\[/code\]as you can imagine the result is like this:Array ( [0] => bla1,bla2, bla3[1] => bla6, bla4[2] => bla11 ....);is there a way to slip this array so that (one more time) i get a slip arrayi have used the above "array_unique" method but is not working - though all google searches lead me to the same result (being the above one)hope you could helpthanks
 
Back
Top