<?php $s = "This is my text.";echo preg_replace('~(?<=\s)\s~', ' ', $s);
Standard input is empty
This is my text.
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!