Re: string vs number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Feb 5, 2008 1:50 PM, Casey <heavyccasey@xxxxxxxxx> wrote:

> I believe this is the difference with arrays:
>
> $a = array(2 => "foo");
> Array(0 => null, 1 => null, 2 => "foo")
>
> $a = array("2" => "foo");
> Array("2" => "foo")
>


i think the implicit type casting applies there as well:

php > $meh = array(2=>4);
php > echo $meh['2'];
4
php > $meh['2'] = 5;
php > echo $meh['2'];
5
php > echo $meh[2];
5

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux