$input_tag = $_POST['tag'];
$input_tag = explode(',', $input_tag);
$input_tag = array_unique($input_tag);
$input_tag = array_diff($input_tag, array(null));
$leng = '';
$true = '';
$comma = '';
foreach ($input_tag as $v) {
if (strlen($v) > 18) {
$leng .= $comma . $v;
$comma = ',';
}
$true .= $comma . $v;
$comma = ',';
}
$true = str_replace(',', '', $true);
if (!preg_match('/^[x80-xff_a-zA-Z0-9]+$/', $true)) {
echo "";
exit;
}
if (!empty($leng)) {
echo "";
exit;
}