Codice PHP:
preg_match_all("#\\w+#",$stringa,$ris);
echo 
implode(',',$ris[0]);