echo implode(' ', array_map(function($d) {
return '<span>'.trim($d).'</span>';
}, explode(',', trim($q, ','))));
$string = "Privet87_ Пока(> Привет ;'_ Poka";
$result = preg_replace("/[^a-zа-я\s]/iu", "", $string);
var_dump($result);
.one path {
fill: #909090;
}
.one.active path {
fill: #f00;
}
const itemSelector = '.one';
const activeClass = 'active';
document.addEventListener('click', function(e) {
const el = e.target.closest(itemSelector);
if (el) {
el.classList.toggle(activeClass);
}
});
// или
document.querySelectorAll(itemSelector).forEach(function(n) {
n.addEventListener('click', this);
}, e => e.currentTarget.classList.toggle(activeClass));