I have a dynamic form in which i can add and remove textarea.
The name of textareas is MyTextarea[]
<textarea style="display:inline;" name="MyTextarea[]"></textarea>
<textarea style="display:inline;" name="MyTextarea[]"></textarea>
So when I want to treat this textarea with PHP i’m doing a :
echo $_POST['MyTextarea'];
So a Array is display on the screen, up to now it’s ok
So I do a print_r($_POST['MyTextarea']); and I have again the same result : Array
I want to know if it’s possible to have many textarea with same name with [] to generate an array.
If it’s possible how can I do, or what’s wrong with my code.
Thanks
Which kind of framework are you using, I’m quite sure there is something at one point that is casting you’re array into a string, maybe something that apply a treatment on POST variable like this:
In this case you’ve to remove this function…
To be sure of what I’m talking about, you can try a var_dump($POST[MyTextarea]) =>string ‘Array’ (length=5) (should be an array)