PHP Count the lenght of each value in a array/string (tags)
- by 2by
Users writing an article have the option to write some tags, tags are written like this:
tag1, tag2, tag3
So tags are stored like: $tags = "tag1, tag2, tag3";
I want to make sure, every tag has a minimum of 3 characters, so i need to validate the tags.
I have tried this:
$tagsstring = explode(",", $tags);
$tagslength = array_map('strlen',…