Jump to content

Replacing a space with -


JSHINER

Recommended Posts

uh... preg_replace(' ','-');  Im not sure if that is exact, but you get the point.

 

Using a regex for such little work is a waste of time. Regular expressions need to be compiled and surely for small operations are slower then pure string manipulation. Using str_replace() is a lot better in this case.

 

Also im not good with regex but that doesnt seem a regex pattern.

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.