A repeat for each line of a text area

A difficult one here using php:

How can I convert a string into an array and then, use it in a repeat function?
My text area will send for example this:

A
B
C
D

On the output I see:
image

What I need is, for each line, a repeat inserts a record on the db.
Tried
{{$_POST.eachline.split('\n')}}
{{$_POST.eachline.split('\r')}}
{{$_POST.eachline.split('\r\n')}}
All of them without success.

Ok, now I now why thanks to @Antony:

But actually the problem is more than that:

If you insert:
image

This is converted to:
image
And I think this is what he means...

So you manually change it to:
image

And you'll think, ok that's it, but no:

image

Somehow the code is not changed at all.
So besides the problem that Antony describes, it seems that also the code is not reflecting the change

All working now :slight_smile:
image

Don't forget to mark your answer as solved

1 Like

… and will your solution break when @patrick fixes the big? :thinking:

I don't think the solution will break, there is nothing wrong with the formatter and it is more an issue with the Wappler UI on how it handles escape characters. The text input in Wappler just accepts text and will correctly escape it for you, so entering an actual new line will result in \n while typing \n will be escaped as \\n. @george should have a look at it on how we could improve the input from UI.