I am currently working on a profile page for my website. Under the profile page you can enter information about yourself under the About section. It first asks you to enter what you want, then it saves it to a variable. After that it gets entered into the database. Then the information is shown on the screen by PHP again.
The problem is the spacing though. Here is a example:
This Is Example Line 1
This Is
Example Line 2
This IS
EXAMPLE LINE 3
ThisIsExampleLine4ThisIsExampleLine4ThisIsExampleLine4ThisIsExampleLine4
When printing to the screen I have been using a <pre>
tag around the PHP variable. When the <pre>
tag is used, everything below is shown the way it was entered. Yet Line 4 will not wrap, because it is in a <pre>
tag, and it is overflowing the <div>
.
Yet when I take out the <pre>
tag, the tag is not using the spaces. So how can I keep the spaces, but also wrap the words?