What is the best way to get array in some drupal data By example, I get this array : 

content_device
    ...
    fields_examples
        und
            0
                sub_field_one
                sub_field_two
                ...
            1
                sub_field_one
                sub_field_two
                ...
            2
                ...
            ...


And currently, if I want modify a subfield, I do this : 

content_device['fields_exemples']['und'][1][sub_field_two] = ...


Is there a best way (drupal or php way) for get a sub data more cleany ? 
I mean (sorry for my poor english writing x) ), I find the "['und'][1]" heavy. If I get the fields_examples array, can I get the sub-arrays '0', '1', '2' ... without use the 'und' in this example ? 

My example isn't very explicit, but I know I have some array in my website who contain sub-sub-sub-...-array in sub-sub-...-array in ... in array. 
And often, an array contain one only sub-array. So if I want get the sub-sub-array, I find the 'only' sub-array very useless, and he complicates the code.

I hope I was clear x)
I'd recommend you to look at entity_metadata_wrapper() function which comes with the Entity API module.


  The Entity API provides wrapper classes you may use to make dealing with the values of an entity's properties and fields easier. Wrappers make it easier to get and set the values of fields and properties as well as to programmatically retrieve additional information about these elements and iterate over lists of values in a consistent manner.


For example, using entity_metadata_wrapper() you can modify a field (or a "subfield" with your terms, I think you mean a field in a field collection) in a following way:

// You should first wrap your node with entity_metadata_wrapper().
$node_wrapper = entity_metadata_wrapper('node', $node);

// To get the value of a field
$field_value = $node_wrapper-&gt;field_example-&gt;value();

// To get the value of a field in a field collection etc.
$field_value = $node_wrapper-&gt;field_example-&gt;sub_field_one-&gt;value();

// To set/modify the value of a field in a field collection etc.
$node_wrapper-&gt;field_example-&gt;sub_field_one-&gt;set('Some new value');

// To save the entity after modifying some values
$node_wrapper-&gt;save();