有时字符串有单字和双字,它适用于单字,但不适用于双字,因为空格
$_POST['descricao'] = "UNITED STATES test";
$_POST['descricao'] = preg_replace("/\b([A-Z]{2,})\b/", "<b>$1</b>", $_POST['descricao']);
输出:<b>UNITED</b> <b>STATES</b> teste
每次我发送我的表格时,它都会再次格式化<b><b>UNITED</b></b> <b><b>STATES</b></b> test
$str = "UNITED STATES test"
对于它应该输出的字符串:<b>UNITED STATES test</b> instead of <b>UNITED</b> <b>STATES</b> test