note 70688 deleted from ref.array by felipe

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: sneskid at hotmail dot com 

----

notice
<?php
$v = array();

$v['0'] = 's';
$v[0] = 'i';
echo $v['0'];
echo $v[0];

$v['.1'] = 's';
$v[.1] = 'i';
echo $v['.1'];
echo $v[.1];

$v['0.1'] = 's';
$v[0.1] = 'i';
echo $v['0.1'];
echo $v[0.1];

// output: iisi

foreach($v as $key => $val) echo $v[$key] . ' : ' . $val . "\r\n";

// output: iisi
?>

This means foreach preserves the key data type, it also means arrays distinguish between float numbers and float like  strings, unlike integers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.