PDA

View Full Version : Break Lines



Shibby-Shabs
08-11-2010, 08:06 AM
So I'm making a page editor (PHP) and obviously people don't wanna put <br /> so I was wondering how I could declare it, I was thinking of using str_replace but what would I replace?

Moh
08-11-2010, 10:28 AM
http://php.net/manual/en/function.nl2br.php

nl2br should do the job :)

I wouldn't insert it into the database with breaks if you plan on editing it in a textarea later on (as textareas work with nl). So when you echo it, just use that function.

Shibby-Shabs
09-11-2010, 09:36 AM
Thanks. You're a legend. +rep

Want to hide these adverts? Register an account for free!