- // Remove first '-' char in tags.
- $tags = preg_replace('/(^| )\-/', '$1', $tags ?? '');
- // Explode all tags separted by spaces or commas
- $tags = preg_split('/[\s,]+/', $tags);
- // Remove eventual empty values
- $tags = array_values(array_filter($tags));
-
- $this->tags = $tags;