Count() returning 1 with comma separated string with explode
问题 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