php nl2br limit x amount

Posted by Joshua Anderson on Stack Overflow See other posts from Stack Overflow or by Joshua Anderson
Published on 2010-06-12T02:49:16Z Indexed on 2010/06/12 2:52 UTC
Read the original article Hit count: 336

Filed under:

Hi this is fairly simple

I want to know how to use nl2br(); in php, but limit the amount of <br/>'s that are allowed at one time.

//For Example: A user enters

hi















Im a jerk and made 16 more lines. or I could make as many as i want




Is there anyway to have php limit the <br/>'s to no more than x amount of numbers at at time

so if we only allowed 4 <br>'s at a time the output would be

hi



Im a jerk I tried to make 9 lines and it made it 4

© Stack Overflow or respective owner

Related posts about php