I have a comma separated string, which consists of a list of tags and want to convert it to array to get a link for every tag.
Example:
$string = \'h
The workaround(!) would be to remove the unwanted trailing characters afterwards:
$tagss = rtrim($tagss, ", ");
This rtrim removes any mix of spaces and commas from the right end of the string.
Btw, you could use str_getcsv instead of explode, which also handles input spaces better.