3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "My text has so much whitespace Plenty of spaces and tabs"; echo preg_replace('/\v(?:[\v\h]+)/', '', $string);

preferences:
65.11 ms | 402 KiB | 5 Q