Re: PHP problem with array keys / pointers

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

 




will set the element of ordinal number 0 and key ' 2'  to 'dog'.  To get
that value you would either ask for $array[0] or $array[' 2'].


thanks for all the comments so far, i'm not sure you are understanding what I am asking for.
My problem is NOT knowing what is in the arrays, but how to access them.

My ordial number/key is a variable, and I need to sometimes use it as a key, and sometimes as an ordial

so I need 2 ways of writing $array[$x],

one being equivalent to $array[0] - $x is treated as an integer
and one being equivalentt to $array['0'] - $x is treated as a string

so far I can only get it to work as an ordial number not a string. Any attempt at apostrophes around $x brings up an error

Any ideas?

Jules
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[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