giorg
127
1
Laravel

textarea lines

Posted 6 months ago by giorg

Hi, I have a textarea like this:

Form::textarea('lista_seriali', null, ['class' => 'form-control', 'required' => 'required'])

where a user need to write 16-length digits per line. In my controller I need to cycle over each line, so I get the request:

var_dump(explode('\r\n', $request->get('lista_seriali')))

but what I get is: array(1) { [0]=> string(34) "0028569756548828 0028569756548829" } so a single string 2 chars more than expected. I tried exploding for 1 space, 2 spaces, \n, \r\n... nothing.

Any hint? Thanks a lot

Please sign in or create an account to participate in this conversation.