PHP Accessing an array element by its index as string literal, good or bad?

inquifoff

New Member
\[code\]$array = array( 'first element', 'second element', 'third element',);echo $array['1'];echo $array[1];\[/code\]They both produce the same result.I am asking this question because I noticed for example drupal accesses the index as string literals, where as php.net uses integers.Are there advantages of one over the other?Of course I know why \[code\]$array[foo]\[/code\] is bad.
 
Back
Top