####pull from editor to for quickkeying####
$str='<taxonomy alias="Abnormal dreams" name="Abnormal dreams" taxonomy_type="adverse_events" content=""/>';
$text = preg_replace_callback('/alias="(.*?)"/im',"toLower",$str);
echo $text;
function toLower($matches){
return 'alias="'.str_replace(' ','-',strtolower($matches[1])).'"';
}