Hey, I have been having ALOT of trouble with this code, I belive it will be a simple task to some1 who has a bit more knowledge then me. <form method="POST"> <input value="Ny" name="State[Ny][]" /> <textarea name="State[Ny][0]"></textarea> <input type="submit" /></form> <?php $State = $_POST['State']; print "<PRE>"; print_r($State); print "</PRE>"; foreach($State as $StateId) { $New = implode("\n",$StateId); $New = explode("\n",$New); print "<PRE>"; print_r($New); print "</PRE>"; } ?> PHP: This produces this Array ( [Ny] => Array ( [0] => this is line 1 ny this is line 2 ny ) ) Array ( [0] => this is line 1 ny [1] => this is line 2 ny ) PHP: What I need to achive is this Array ( [Ny] => Array ( [0] => this is line 1 ny [1] => this is line 2 ny ) ) PHP: Ive been trying to solve this problem for too many hours now, Its very frustraiting. The furthest Ive gotten is adding those values in the main array under Ny, But not in Ny Thanks in advance, Hope to hear some replies
Have you tried: <input value="Ny" name="State[Ny][1]" /> Code (markup): Instead of: <input value="Ny" name="State[Ny][]" /> Code (markup): Jay