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
https://forums.phpfreaks.com/topic/153890-input-array-sorting-automatically/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.