I have a text where I want to bypass using the css property white-space:
white-space: pre-line
How can I replace white-spaces in a text with a break (<br>
) in PHP so that I have the same output like using white-space: pre-line
?
Example:
GET / HTTP/1.1 Referer: http://192.168.2.154/ Cookie: PHPSESSID=s0p0vc93nf630ornkvdprgc5ko;security=impossible Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding: gzip,deflate Host: 192.168.2.154 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36 Connection: Keep-alive
How can I format this code without css (white-space) that I have it like this:
GET / HTTP/1.1
Referer: http://192.168.2.154/
Cookie: PHPSESSID=s0p0vc93nf630ornkvdprgc5ko;security=impossible
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate
Host: 192.168.2.154
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36
Connection: Keep-alive
', $text); – itranger Nov 04 '20 at 17:16