⭐ in reply to How do you limit textarea of a form
If you want to clump everything into a single line (maybe for reformatting it yourself, see Text::Wrap or my Nicely format a list or a string snippet):s/\n{2,}/\n/g;
If you want to cut it to the first 5 non-empty lines:s/\s+/ /g;
I don't think there is an HTML attribute to restrict the number of lines in a TEXTAREA.$text=join("\n",(split(/\n+/,$text))[0..4])
--ZZamboni
|
|---|