Saturday, October 25, 2008

eat up spaces (replace space) to single space


<?php
$string = 'This string has no whitespaces.';
echo ereg_replace( ' +', ' ', $string );
?>

No comments: