html - PHP Textarea append -
ok let's have textarea , type in textarea
hello name frank , eat apples. then when hit submit button get:
[hello name is] [frank , like] [to eat apples.] see how every line appended @ start , end brackets?
is there way can in php?
yes:
$output = '['.str_replace("\n", "]\n[", $input).']'; i'm not sure if textarea sends \n or \r\n. if latter, change \n \r\n in above.
Comments
Post a Comment