So I’m working on a tags system, and I have a field that looks like this:
<input name="tags" type="text" />
And I want a user to be able to type tags like (comma separated): “Tag one, Tag two, Tag Three” and so on, and then in the backend PHP, pull each tag by itself and put them all into an array, such as:
$tags = array("Tag one", "Tag two", "Tag three");
And then I’m thinking using foreach to insert them into their own rows in a database, which I know how to do and all; but I digress. But how do I separate the tags in the string from the user’s form input?
You can do this with the explode function: