<?php $string = 'Você está bem? 123 # ! @ ...';echo preg_replace('/[^\w\s+$]/u', '_', $string);
Standard input is empty
Você está bem_ 123 _ _ _ ___
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!