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!