Remove duplicates from field [array] I am using php in views and trying to make a custom field to remove the duplicates in [field_trucks_notification_no_ref_node_eb:field_trucks_agency] field, i tried to use the row->field_name from the available variables in Global:PHP (output) with no luck.

 stdClass Object
    (
        [entity] =&gt; 268
        [_entity_properties] =&gt; Array
            (
                [search_api_relevance] =&gt; 1
                [search_api_excerpt] =&gt; 
                [search_api_id] =&gt; 268
                [field_cons_country_border] =&gt; 35604
                [field_trucks_notification_no_ref_node_eb] =&gt; Array
                    (
                        [0] =&gt; 269
                        [1] =&gt; 272
                        [2] =&gt; 278
                    )

                [field_trucks_notification_no_ref_node_eb:field_trucks_agency] =&gt; Array
                    (
                        [0] =&gt; 35617
                        [1] =&gt; 35621
                        [2] =&gt; 35617
                    )


EDIT: using Global:PHP field in views, How can I retrieve the values of the last field (array) above and remove duplicates?
To remove duplicates in Views, if the views advanced settings "Distinct" don't operate, have a look at Views Distinct module: https://www.drupal.org/project/views_distinct. Really useful project and sounds better than php in views.