I have a field that stores tags comma seperated. I'm trying to count the number of items listed.
Let's say I've already pulled the data from the DB, and the $tags variable has the following info:
$tags = "Videos,Magazines,Store";
// First separate tags by commas, put into into array
$tagArray = explode(",",$tags);
// Count how many items are in the array
$arrayCount = count($tagArray);
That always returns "1", regardless if there's an item in the array or not. the $tags variable can have any number of items - from empty, to a single item like "Videos" to multiple items "Videos,Games,Store" etc.
Can someone help me out on what I'm doing wrong?