Peggy Posted August 10, 2009 Share Posted August 10, 2009 OK I know this is a simple question. So please bear with me. I have built an administration end on a web site. Scenario: • The administrator is enters data that is more than one paragraph. • Data goes into the database. • Then when I display that data on the web I want to insert “<p></p>” at the same place the administrator started the new paragraph. I know this should be easy. I looked for “\r” or “\n” in the data in the data base but there was none. I tried the code below but it isn't reliable. Besides I realize that this is just a work around and there is a better more “conventional” way. $par_one = $row[$category . '_par_one']; $pattern = '/[[:space:]]{5,}/'; $category_par_one = preg_replace($pattern, '</p><p>', $par_one ); Link to comment https://forums.phpfreaks.com/topic/169537-inserting-a-paragraph-tag/ Share on other sites More sharing options...
The Little Guy Posted August 10, 2009 Share Posted August 10, 2009 I think I just had this same problem: http://www.phpfreaks.com/forums/index.php/topic,263838.0.html Link to comment https://forums.phpfreaks.com/topic/169537-inserting-a-paragraph-tag/#findComment-894511 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.