Return category list as an array rather than outputting text.