0

I want to remove all enters from an input and replace them with a single space. By that I mean something as </br>. So if someone places the input like this

Hello, my name is bob.
How are you?

It will look like this,

Hello, my name is bob. How are you?

How can this be done in php?

4
Contributors
3
Replies
19
Views
3 Years
Discussion Span
Last Post by buzzfire
0

I want to remove all enters from an input and replace them with a single space. By that I mean something as </br>. So if someone places the input like this

@garyjohnson

I got no idea what you have just mention? Is this related to PHP or CSS?

Can you explain a little more what you just mention?

Is this a text editor issue?

The question you ask doesn't really make any sense because I feel you didn't explain it clearly

Edited by LastMitch

0

Do you have some script you are working with that you can post ?

Edited by Tko_1

0

PHP is a server sided scripting language, so thereforth you cannot change an enter key to turn out as a space unless when the form is submitted all <br/> are changed to " ". I don't know if that is possible because in the code an enter might not be a <br/> but I believe that you would use preg_replace. So when your working with php just note that all php is executed before the page is loaded and not afterwards or during. That being said you will need to use Javascript or some other client side language that works after the page is loaded. Not really sure whether you want it to create a space as the user is typing or after once it's submitted.

Edited by buzzfire

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.