Klar.
PHP-Code:
<?php
if (isset($_POST['tags'])
&& is_string($_POST['tags'])
&& trim($_POST['tags']) !== ''
) {
$tags = array_map('trim', explode(',', $_POST['tags']));
// Leere Einträge entfernen
$tags = array_filter($tags, function ($e) {
return ($e !== '');
});
if (count($tags) > 0) {
// Debug
var_dump($tags);
}
}
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>New</title>
</head>
<body>
<form method="post" action="">
<p>Enter some tags: <input type="text" name="tags" /> (separate by comma)</p>
<p><input type="submit" />
</form>
</body>
</html>