PHP Programming > General PHP Help

escape control characters like \n,\r,\\,\t with echo

(1/1)

flower:
hi,I am struggling to output or echo something as simple as:

echo "This\n";
echo "people\n";
echo "are good";

I get: "This people are good"-in one line,

But I wan't it as:
This
people
are good

I can't also carry on to the other characters like \r or \t, e.t.c since I am still stuck on this one, I AM A COMPLETE BEGINNER,PLEASE HELP

wilson382:
\n means new line but when you need to display as HTML you need to do it this way instead


--- PHP Code: ---
echo "This <br/>";
echo "people <br/>";
echo "are good<br/>";

--- End code ---

Navigation

[0] Message Index

Go to full version