如何使用preg_replace将多个下划线替换为一个下划线?

最佳答案

preg_replace('/[_]+/', '_', $your_string);

10-07 18:05