mysql returns an assoc array that also have numerical keys,
perhaps you're thinking of that...
to my knowledge, PHP never supported numeric & string
indexing to it's assoc. arrays... i've tested the code
below on PHP v4.0.4 and v4.0.6 and it runs the same:
numerical index values return nothing.
<?
$bar = array (
'foo' => 'first',
'bar' => 'second',
'more' => 'third',
);
$my_arr['foo']='first';
$my_arr['bar']='second';
$my_arr['more']='third';
echo "<p>" . $my_arr[0] . "</p>\n";
echo "<p>" . $my_arr[1] . "</p>\n";
echo "<p>" . $my_arr[2] . "</p>\n";
echo "\n";
echo "<p>" . $bar[0] . "</p>\n";
echo "<p>" . $bar[1] . "</p>\n";
echo "<p>" . $bar[2] . "</p>\n";
for($i=0;$i<count($my_arr);$i++)
{
echo "<p>" . $my_arr[$i] . "</p>\n";
}
for($i=0;$i<count($bar);$i++)
{
echo "<p>" . $my_arr[$i] . "</p>\n";
}
while ( list($k,$v) = each($bar) ) {
print "$k = $v\n";
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]