<?php

$text = "                　  Text\x0B\r\n\t";
$res = preg_replace("/\s/u", "_", $text);
echo $res;
