Removing excess spaces?
Posted 04 August 2006 - 10:51 PM
So if I were to have, say:
it would shorten it down to
I'm not sure how to go about doing it though. Any tips?
Posted 05 August 2006 - 06:53 AM
(\040)+ -- this is the meta character represent space.. and + sign represent if you want to remove multiple spaces.
Posted 05 August 2006 - 02:21 PM
<?php $string = trim (preg_replace ('`[\s]+`', ' ', $string)); ?>
Hope it helps
Posted 05 August 2006 - 10:42 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users