Reputation: 1557
I am trying to replace a certain word in php and include a whitespace in it.
This string will eventually be encode as html format. However, after encoding in html format,   always turns up to be a 'newline' instead of 'one standard space'. May i know why is that so? Thanks
$storeAddr = preg_replace('/test/', "<br> test1", $storeAddr);
I.E
string: 1)xxxxtestxxxx
current output: 1)xxx
testxxxx
desired output: 1)xxx
testxxxx
Upvotes: 0
Views: 129
Reputation: 22386
Do you know what <br>
is doing?
It inserts line break. So in your code <br>
turns up to be a 'newline'.
Upvotes: 1