Lynae Posted November 22, 2011 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"); Link to comment Share on other sites More sharing options...
Paul Swanson Posted November 22, 2011 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 Link to comment Share on other sites More sharing options...
Lynae Posted November 22, 2011 Author Share Posted November 22, 2011 Thank you! It works! Link to comment Share on other sites More sharing options...
Paul Swanson Posted November 23, 2011 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. Link to comment Share on other sites More sharing options...
Recommended Posts