Lynae 2 Posted November 22, 2011 Report Share Posted November 22, 2011 I am working on #4 pursue (chapter 12): convert newline characters into HTML break tags: It looks like I need to use the n12br but I can't get it to work in my view_entry.php. I thought I could simple add this code after the print below but it doesn't work. Many examples that I found show using the echo but I tried that and it doesn't work either. Any suggestions? while ($row = mysql_fetch_array($r)){ print n12br("<p><h3>{$row['title']}</h3> {$row['entry']}<br /> <a href=\"edit_entry.php?id={$row['entry_id']}\">Edit</a> <a href=\"delete_entry.php?id={$row['entry_id']}\">Delete</a> </p><hr />\n"); Quote Link to post Share on other sites
Paul Swanson 104 Posted November 22, 2011 Report Share Posted November 22, 2011 You have the function name wrong; it should be nl2br(), not n12br(). That's a lower-case L, not the digit one. Read it as "nEW lINE to brEAK" Typography can mess you up sometimes... 1 Quote Link to post Share on other sites
Lynae 2 Posted November 22, 2011 Author Report Share Posted November 22, 2011 Thank you! It works! Quote Link to post Share on other sites
Paul Swanson 104 Posted November 23, 2011 Report Share Posted November 23, 2011 You're welcome. With some fonts it's tough to tell a lower-case L from a one from a capital i. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.