Here's a faster way to do what's described below:
<?php
$string = 'This string has no whitespaces.';
echo ereg_replace( ' +', '', $string );
?>
Output: Thisstringhasnowhitespaces.
If you want it to replace only single whitespaces instead of
both single and cascading dito, remove the + in the first
parameter of ereg_replace().
----
Server IP: 129.16.214.50
Probable Submitter: 83.227.160.33
----
Manual Page -- http:/
/www.php.net/manual/en/function.trim.php
Edit -- https://master
.php.net/note/edit/76022
Del: integrated -- h
ttps://master.php.net/note/delete/76022/integrated
Del: useless -- http
s://master.php.net/note/delete/76022/useless
Del: bad code -- htt
ps://master.php.net/note/delete/76022/bad+code
Del: spam -- https:/
/master.php.net/note/delete/76022/spam
Del: non-english --
https://master.php.net/note/delete/76022/non-english
Del: in docs -- http
s://master.php.net/note/delete/76022/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/76022
Reject -- https://mast
er.php.net/note/reject/76022
Search -- https://
master.php.net/manage/user-notes.php
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|