The user will input on a text field something like this:
$list = "hello, internet, connection, wireless"
I'm getting them out with the following:
$tags = explode(',', $list);
The problem is that before I do that, I need to validate whether the format of the string captured in the $_POST
actually has that format. Any ideas how can I do that? I'm not an experienced PHP programmer, I usually just work on front end development.
The user can input more than 4 tags, it's not always going to be 4, he can put 5 or 6 with a maximum of 7, the output I want is to have on an array, all the words in the string, the background for this is that I'm making a simple helpdesk, where users can ask a question, and I will return all the results according to the found tags in the question the user has input.
So I really need to make sure that when the ADMIN of this helpdesk is typing the tags, they're on that format:
$data = "internet, connection, wireless, internet-explorer";