Posted by jens on 11/02/05 18:35
>When PHP has a non-numeric index [i.e. 'host'], it also reserves a
>numeric index for the item (i.e. 1).
That is a complete myth(or at least not the case in never versions of
.....true many functions that such as the mysql functions return value
under both numeric and alphanumeric indexes... but it's not default
behavior.
e.g i set:
$test = array();
$test['foo'] = 'bar';
var_dump($test[0]);
See Also:
http://docs.php.net/en/language.types.html#language.types.array
>When you use print_r to print the array, you see both the non-numeric
>and numeric indicies.
only if both are explicitly set
Navigation:
[Reply to this message]
|