When upgrading from php 4.0.4 to 4.2.3 I had a problem in my scripts with checkbox arrays. In my form I named the checkbox as name="sample[]". When I received and parsed the data, it dropped the first four characters in each value. For example on my form I have:
<input type="checkbox" name="sample[]" value="sampleone">
<input type="checkbox" name="sample[]" value="sampletwo">
On the page it posts to I have:
$count=count($sample);
for ($i=0; $i<$count; $i++) {
echo "sample $i = \"$sample[$i]\"<br>";
}
However, the data that is displayed is:
sample 0 = "leone"
sample 1 = "letwo"
It is dropping the first four characters. I have searched everywhere to find a solution either a bug with the version, a difference in the php.ini file between versions, if there is a parser file that needs modification, etc. I just can't figure it out! Any help or suggestions are appreciated! Thanks.