On Sun, 2006-12-17 at 23:19 +0000, julian haffegee wrote: > > 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 $array['0'] and $array[0] are identical in PHP. The string '0' will be automatically juggled to an integer when used as an index. You CANNOT differentiate even if you want. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php