By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,750 Members | 1,456 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,750 IT Pros & Developers. It's quick & easy.

using preg_replace to remove spaces as well..

P: n/a
I am using this to remove everything except the 0-9 and a-z characters,
but I also want to remove blanks spaces as well(yes even ones in
between words)

$strippedtext = preg_replace('/[^0-9a-z]/i','',$originaltext);

Please help.

Thx

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Fri, 08 Jul 2005 03:34:52 -0700, john wrote:
I am using this to remove everything except the 0-9 and a-z characters,
but I also want to remove blanks spaces as well(yes even ones in
between words)

$strippedtext = preg_replace('/[^0-9a-z]/i','',$originaltext);

Please help.

$stripper=preg_replace('/\s+/','',$str);

--
http://www.mgogala.com

Jul 17 '05 #2

P: n/a
Somebody wrote:
I am using this to remove everything except the 0-9 and a-z characters,
but I also want to remove blanks spaces as well(yes even ones in
between words)

$strippedtext = preg_replace('/[^0-9a-z]/i','',$originaltext);


What makes you think that doesn't remove 'blank spaces'?

What do you think it does?

--
Jock
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.