Reputation:
I saw lots of questions about how to use PHP new line delimiters but none really addressing the problem I have. So I have Contact information that is acquired from a Java program using the \n
delimiter that is nicely stored with new lines functioning properly in a TEXT column in my MySQL database, appearing like so:
First Name:AT&T Check Bill Balance
Phone number:*225#
First Name:AT&T Customer Care
Phone number:1-800-331-0500
However when using PHP to call the text to display in the browser using:
echo htmlspecialchars($ContactList, ENT_QUOTES, 'UTF-8');
To display all the data stored in the field, it appears as a sloppy blob of texts with no new lines like so:
First Name:AT&T Check Bill Balance Phone number:*225# First Name:AT&T Customer Care Phone number:1-800-331-0500
Is there anyway to fix this just using PHP or am I going to have to clear the data, go back to the Java Program, use the PHP delimiter instead and then resend the information?
Thanks!
Upvotes: 1
Views: 100
Reputation: 9
php displays it in a webpage, so a webpage will not display the newline characters as a new line. You would have to put in some css or "less than symbol" br "greater than symbol" to enter a new line where you want to create a new line.
Upvotes: 1