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?
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?
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.
Last edited by Moh; 08-11-2010 at 10:30 AM.
Thanks. You're a legend. +rep
Want to hide these adverts? Register an account for free!