# Detecting a New Line with PHP

**URL:** <https://forum.kirupa.com/t/detecting-a-new-line-with-php/193595>\
**Category:** programming\
**Created:** [July 14, 2006, 1:07pm UTC](https://forum.kirupa.com/t/detecting-a-new-line-with-php/193595 "2006-07-14T13:07:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esherido](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/esherido/32/2158_2.png) [@Esherido](https://forum.kirupa.com/u/Esherido)\
**Post date:** [July 14, 2006, 1:07pm UTC](https://forum.kirupa.com/t/detecting-a-new-line-with-php/193595/1 "2006-07-14T13:07:06Z")

</div>

Hi Kirupians,  
I’m guessing there’s something already on this but, and I’ve searched for it, but I wasn’t able to find it. I have a text box that I enter text into, like blog or forum posts for example. Then it is submitted to a PHP “parser” which goes through what was submitted and adds \<b\>'s and \<h5\>'s and \<a\>'s where necessary. I was wondering, how do I make PHP detect a new line and replace it with a \<br /\>?
