This should be easy, but I cannot get there.
I am writing a program in php for a friend to put his poetry online. The poems are stored in MySql. The problem is carriage returns. When I use phpMyAdmin the lines are formatted correctly, but when I use echo in php the whole poem comes out as a string of text.
I am uploading the poetry using
$poetry = htmlentities($_POST['Poetry']);
The problem seems to be getting the data from sql and displaying it.
It would be helpful if I could see the exact characters (including ALL entities such as carriage returns) that php is supplying to the browser (Chrome).
Any ideas?
` tag. HTML doesn't take any notice of the kinds of newlines used in text files, such as `\n` – ADyson Nov 24 '21 at 15:12
but don't know how to. – Max Kite Nov 25 '21 at 10:53
but don't know how to`...Nico Haase already suggested how to do that yesterday - did you follow up that comment by investigating the suggested function? – ADyson Nov 25 '21 at 11:14
this is line one This is line two this is line three this is line four >>>>>>This is what I see when I do what you suggest and copy/paste (into SciTE) which is correct. When I request 'see end of line' it puts CRLF at the end of each line in grey boxes. How do I convert CRLF to
? – Max Kite Nov 25 '21 at 11:19
`... again, see https://stackoverflow.com/questions/70098443/how-can-i-see-html-control-entities-in-chrome?noredirect=1#comment123914721_70098443 and also https://stackoverflow.com/questions/70098443/how-can-i-see-html-control-entities-in-chrome?noredirect=1#comment123914721_70098443 – ADyson Nov 25 '21 at 11:20
" [into google](https://www.google.com/search?q=php+How+do+I+convert+CRLF+to+%3Cbr+%2F%3E) and get the necessary information instantly, without needing to wait for people to spoon-feed you. :-) – ADyson Nov 25 '21 at 11:22