This is a really simple question which I’m struggling with. I have a variable ($foo) which is an array created from a sql call.
When I am referencing a field in code what is the difference between
$foo['bar'] and $foo->bar ?
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.
references an element with the key ‘bar’ in an array assigned to the variable $foo, as retrieved by mysql_fetch_array()
references the property called ‘bar’ in an object instance in the variable $foo, as retrieved by mysql_fetch_object()