<?php $str = '1 h 19 min';$str = preg_replace('/(?<=\d) *(?=\D)/', '', $str); echo $str;
Standard input is empty
1h 19min
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!