Jump to content

input array sorting automatically


bigdoggy59

Recommended Posts

This is the strangest thing I've ever seen...

 

Building an HTML form from a query I have:

   echo $nsn;
echo "<input type='hidden' name='NSN[$idx]' value='$nsn'/>";
echo "</td>\n"; 

 

Looking at the source in the browser I see:

<input type='hidden' name='NSN[0]' value='8465014652096'/>
<input type='hidden' name='NSN[1]' value='GSA-700'/> 

 

On the next page, a print_r($NSN) returns:

Array ( [0] => GSA-700 [1] => 8465014652096 ) 1

 

Note that the index numbers=>values have been re-ordered.  Why is this happening and how do I stop it?  None of the other arrays in the app are doing this, only this one.

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.