Jump to content

[SOLVED] preg_replace whitespace for underscore...


socalnate

Recommended Posts

I've not tested but a google search gave me these:

 

ALL WHITESPACE NOT JUST THE SPACE CHARACTER:

$after=preg_replace('/\s+/','',$before);

 

ALL SPACES:

$nospaces = str_replace(' ', '', $input);

 

NEWLINE AND CARRIAGE RETURN:

(added just in case you needed it too)

str_replace("\n", '', $input);
str_replace("\r", '', $input);

 

EDIT:  Decided to come back and identify the code as code :D (sorry)

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.