Imad Posted July 3, 2008 Share Posted July 3, 2008 Hi guys, I need help with checking for line breaks. I want to create a system that makes each line made in a textbox a bullet or <li>. Any help would be greatly appreciated. Best Regards. Link to comment https://forums.phpfreaks.com/topic/113146-how-to-check-for-line-breaks/ Share on other sites More sharing options...
teynon Posted July 3, 2008 Share Posted July 3, 2008 Line breaks are \n or \r. so do something like... $text=preg_replace("@\n\r@", "<li>", $text); Link to comment https://forums.phpfreaks.com/topic/113146-how-to-check-for-line-breaks/#findComment-581274 Share on other sites More sharing options...
Imad Posted July 3, 2008 Author Share Posted July 3, 2008 Thanks for your help, I'll try it out. Best Regards. Link to comment https://forums.phpfreaks.com/topic/113146-how-to-check-for-line-breaks/#findComment-581277 Share on other sites More sharing options...
teynon Posted July 3, 2008 Share Posted July 3, 2008 preg_replace("@[\n\r]@", "<li>", $text); Link to comment https://forums.phpfreaks.com/topic/113146-how-to-check-for-line-breaks/#findComment-581278 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.