How can I replace <br>, \r, \n with " ". Which is an empty space. Is there a way to detect these characters in a string and replace them with a single white space?
garyjohnson
14
Junior Poster
Recommended Answers
Jump to PostIf I recall (i am sorry if i am wrong) but you can use
 
to create a space (as far as i am aware of, this works in html to create a single space).You are asking for a single space right?
Jump to Post@sparker, I think it's fair to assume he's talking about PHP here, give that he posted the question in the PHP forum.
To answer the question: in PHP, simple string replacement can be done using the
Jump to PostThe   entity should indeed create a space, but a "thin" space, which is shorter than a normal space. How short would depend on the browser, but it could be significantly shorter.
A standard space can be added in HTML using the entity. I'd recommend that instead, since …
All 10 Replies
sparker
0
Newbie Poster
<M/>
170
Why so serious?
Featured Poster
Atli
182
Posting Pro
<M/>
commented:
ah, much bettter
+8
<M/>
170
Why so serious?
Featured Poster
mmcdonald
28
Posting Pro

diafol
mmcdonald
28
Posting Pro
Atli
182
Posting Pro

diafol
mmcdonald
28
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.