How to load multiple values from a field with views_php module? I'm trying to build a responsive gallery. Since views won't let me rewrite the field's output with html5 data attributes I need to print the output using a PHP field in views.

Using the module views_php, I'm accessing the values of the image field this way:

$source = $data-&gt;_field_data['nid']['entity']-&gt;my_field['und'][0]['filename'];


This way I load the value from the ['und'][0] array, this would work properly if a field  has a single value.
But what if in the node creation, in my field I want to upload multiple images. How could I change the [und] numerical value to load as many values as my field has. 

Thanks in advance.
As Syd said, it seems like you need a foreach loop. It's not readily apparent what you're wanting to do with the $source variable, but I'm guessing it's something like the following:

foreach ($data-&gt;_field_data['nid']['entity']-&gt;my_field['und'] as $a_file) {
    echo '&lt;img src="' . $a_file['filename'] . '"&gt;';
}