String helper class

PHP – br2nl

As a reverse function of nl2br you can use:

IP Detection

This little snippet tries to get the IP-Address of the user:



Hence nl2br does NOT really replace newlines with <br /> tags (it only inserts a <br /> tag before each \n → newlines themselves are preserved), you can use this function to get it right (realNl2Br):