<?php $text = " Text\x0B\r\n\t";$res = preg_replace("/\s/u", "_", $text);echo $res;
Standard input is empty
___________________Text____
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!