Jump to content

[SOLVED] replace regular expression for two or more spaces


climbjm

Recommended Posts

I want to take any string of two or more spaces and replace it with one space.

[code]
$string = "          ";
$string = ereg_replace("\s\s*"," ",$string);
[/code]

you get the idea...

I have a valid reason for needing this, but it is too long to explain.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.