Question: I'm a CI newbie and I can't wrap my head around trying to access a single element from an array; I have uploaded an image, and would like to know size before additional processing.

```
$imgOriginalData = array('upload_data' => $this->upload->data());

print_r ($imgOriginalData); // shows that [image_width] is a property that exists
echo element('image_width', $imgOriginalData); // returns "Array"

if ($imgOriginalData['image_width'] > 800){ // throws error Undefined index: image_width

echo "<p>Greater than 800</p>";
}else{
    echo "<p>less than 800</p>";
}

```

Answer: 
According to your code snippet:

```
$imgOriginalData = array('upload_data' => $this->upload->data());

```

The required key you're looking for should be:

```
echo $imgOriginalData[ 'upload_data' ][ 'image_width' ]

```

**Edit**: You were basically creating a new sub array at the index `upload_data` so you need to address the data array returned by the upload library ( `$this->upload->data()` ) through the `upload_data` key.
Instead of doing `$imgOriginalData = array('upload_data' => $this->upload->data());`

Just do `$imgOriginalData = $this->upload->data();`

Then to get width, use `$imgOriginalData['image_width']` like you have in your if statement.