Possible Duplicate:
Is it okay to use array[key] in PHP?
Is there any significant different between
$test['car'] and $test[car]
Both produce same result.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In
$test[car],caris expected to be a constant. Constants are bare words without quotes or preceding$. If you do not have a constant namedcardefined, PHP will assume you meant'car'. That’s very bad behavior, but it is what it is. If you’d activate error reporting as you should during development, you’d see a lot of errors pointing this out.