Log in

View Full Version : Trick to modify sentence


SilverBoy
06-01-2016, 06:49 PM
Hi

I know that it is maybe not post this thread here, but I posted here because I want a template code to do this.

what I want is replacing the space from a variable and replace it with + in template.

To make it clear see this example ..
If my variable value is «Dan Brown»
I want a trick to print it in the output like «Dan+Brown»

Any Idea?

MarkFL
10-15-2016, 06:53 AM
I would use PHP myself, within a plugin, with something like:

$str = str_replace(' ', '+', $str);

The hook location will depend on where the variable is being used.