我需要在字符串中找到所有大写单词并将其设置为粗体
$_POST['descricao'] = "UPPERCASE test WORD"
$_POST['descricao'] = preg_replace("\b[A-Z]{2,}\b", "<b>\\1</b>", $_POST['descricao']);
它应该返回:<b>UPPERCASE</b> test <b>WORD</b>
我需要在字符串中找到所有大写单词并将其设置为粗体
$_POST['descricao'] = "UPPERCASE test WORD"
$_POST['descricao'] = preg_replace("\b[A-Z]{2,}\b", "<b>\\1</b>", $_POST['descricao']);
它应该返回:<b>UPPERCASE</b> test <b>WORD</b>