无法从数组中获取价值

Why isn't this working?

print_r($photo);
echo $photo['type'];

this is outputting:

Array ( ['type'] => newPhoto ['fileName'] => 133249963433.jpg ) 

Notice: Undefined index: type in /path/to/Logic.php on line 153
Notice: Trying to get property of non-object in /path/to/Logic.php on line 154

This has to be so simple though..?

edit:

FOUND THE SOLUTION, but i can't post it as solution, because i don't have enough reputation points.

The array was generated from a form with php generated hidden inputs. I named those inputs like this:

name="photos['.$uniqid.'][\'type\']" value="exisitingPhoto">
name="photos['.$uniqid.'][\'fileName\']" value="'.$photoTag['photoName'].'">`

It has to be this:

name="photos['.$uniqid.'][type]" value="exisitingPhoto">
name="photos['.$uniqid.'][fileName]" value="'.$photoTag['photoName'].'">`

So, the backslashes and ' ' are not allowed in this.

Thank you all for the help!

Just for debugging purposes please try

$key = 'type';
print_r($photo);
if ( isset($photo[$key]) ) {
    echo $photo[$key];
}
else {
    echo __FILE__, ':', __LINE__, ' $photo[$key] not set', "<br />
";
}