i guess you are learning php programming, you should learn to differ array from object and how to access them, php doc will be very usefull, you should have it on hand
Yes, but it is easy to have detailled informations about the variables we use, var_dump(expression) is made for that, it gives the whole structure of the expression (can be a variable, but can be something else) with the type of each compenent, i use to debug using it.
So if you put var_dump each time you have a problem with a variable, you will know if it is an array, object, string, bool ...
Then you can easily walk into it. The previous example was to help you figure out how many types of variables you are crossing, but the class i sent you will directly return the required data.