使用array_unique,我似乎已经删除了重复的记录?

Within available_options I have somehow stripped out Express when I just wanted to keep one of them?

The array looks like this

["options"]=>
array(9) {
  [0]=>
  array(8) {
    ["id"]=>
    string(2) "79"
    ["product_id"]=>
    string(2) "15"
    ["sku"]=>
    string(9) "CSR-FTC4S"
    ["status"]=>
    string(1) "1"
    ["is_default"]=>
    string(1) "0"
    ["option_price"]=>
    string(6) "35.000"
    ["sequence"]=>
    string(4) "9999"
    ["available_options"]=>
    array(3) {
      [0]=>
      array(6) {
        ["id"]=>
        string(3) "219"
        ["product_options_base_id"]=>
        string(2) "79"
        ["option_id"]=>
        string(2) "16"
        ["option_data_id"]=>
        string(1) "1"
        ["sequence"]=>
        string(4) "9999"
        ["option_data"]=>
        array(1) {
          [0]=>
          array(8) {
            ["id"]=>
            string(1) "1"
            ["admin_name"]=>
            string(19) "Five Ten C4 Stealth"
            ["name"]=>
            string(11) "Resole Type"
            ["sku"]=>
            string(5) "FTC4S"
            ["user_value"]=>
            string(25) "Five Ten C4 Stealth 5.5mm"
            ["sequence"]=>
            string(1) "0"
            ["status"]=>
            string(1) "1"
            ["option_price"]=>
            string(5) "0.000"
          }
        }
      }
      [1]=>
      array(6) {
        ["id"]=>
        string(3) "220"
        ["product_options_base_id"]=>
        string(2) "79"
        ["option_id"]=>
        string(2) "12"
        ["option_data_id"]=>
        string(1) "1"
        ["sequence"]=>
        string(4) "9999"
        ["option_data"]=>
        array(1) {
          [0]=>
          array(8) {
            ["id"]=>
            string(1) "1"
            ["admin_name"]=>
            string(7) "Express"
            ["name"]=>
            string(7) "Express"
            ["sku"]=>
            string(3) "EXP"
            ["user_value"]=>
            string(1) "1"
            ["sequence"]=>
            string(4) "9999"
            ["status"]=>
            string(1) "1"
            ["option_price"]=>
            string(6) "25.000"
          }
        }
      }
      [2]=>
      array(6) {
        ["id"]=>
        string(3) "221"
        ["product_options_base_id"]=>
        string(2) "79"
        ["option_id"]=>
        string(2) "23"
        ["option_data_id"]=>
        string(1) "1"
        ["sequence"]=>
        string(4) "9999"
        ["option_data"]=>
        array(1) {
          [0]=>
          array(8) {
            ["id"]=>
            string(1) "1"
            ["admin_name"]=>
            string(16) "Rand Toe Patches"
            ["name"]=>
            string(3) "RTP"
            ["sku"]=>
            string(3) "RTP"
            ["user_value"]=>
            string(1) "1"
            ["sequence"]=>
            string(4) "9999"
            ["status"]=>
            string(1) "1"
            ["option_price"]=>
            string(6) "10.000"
          }
        }
      }
    }
  }
  [1]=>
  array(8) {
    ["id"]=>
    string(2) "80"
    ["product_id"]=>
    string(2) "15"
    ["sku"]=>
    string(10) "CSR-FTONYX"
    ["status"]=>
    string(1) "1"
    ["is_default"]=>
    string(1) "0"
    ["option_price"]=>
    string(6) "37.000"
    ["sequence"]=>
    string(4) "9999"
    ["available_options"]=>
    array(3) {
      [0]=>
      array(6) {
        ["id"]=>
        string(3) "222"
        ["product_options_base_id"]=>
        string(2) "80"
        ["option_id"]=>
        string(2) "16"
        ["option_data_id"]=>
        string(1) "2"
        ["sequence"]=>
        string(4) "9999"
        ["option_data"]=>
        array(1) {
          [0]=>
          array(8) {
            ["id"]=>
            string(1) "2"
            ["admin_name"]=>
            string(13) "Five Ten Onyx"
            ["name"]=>
            string(11) "Resole Type"
            ["sku"]=>
            string(6) "FTONYX"
            ["user_value"]=>
            string(19) "Five Ten Onyx 4.5mm"
            ["sequence"]=>
            string(1) "1"
            ["status"]=>
            string(1) "1"
            ["option_price"]=>
            string(5) "0.000"
          }
        }
      }
      [1]=>
      array(6) {
        ["id"]=>
        string(3) "223"
        ["product_options_base_id"]=>
        string(2) "80"
        ["option_id"]=>
        string(2) "12"
        ["option_data_id"]=>
        string(1) "1"
        ["sequence"]=>
        string(4) "9999"
        ["option_data"]=>
        array(1) {
          [0]=>
          array(8) {
            ["id"]=>
            string(1) "1"
            ["admin_name"]=>
            string(7) "Express"
            ["name"]=>
            string(7) "Express"
            ["sku"]=>
            string(3) "EXP"
            ["user_value"]=>
            string(1) "1"
            ["sequence"]=>
            string(4) "9999"
            ["status"]=>
            string(1) "1"
            ["option_price"]=>
            string(6) "25.000"
          }
        }
      }

and my code goes like this

        foreach($this->_data as &$data) {

        foreach($data['options'] as &$option) {

            $option['available_options'] = array_unique($option['available_options']);

        }

    }

It's working apart from it's stripped out the duplicates rather than showing them once?

array_unique does not work recursively, you need to go inside your array to apply it on option_data directly.

foreach($this->_data as &$data) {
    foreach ($data['options'] as &$option) {
        foreach ($option['available_options'] as &$available_option) {
            foreach ($available_option['option_data'] as &$option_data) {
                $option_data = array_unique($option_data);
            }
        }
    }
}

This way, the last option_data looks like

'option_data' => [
    [
        'id'           => '1',
        'admin_name'   => 'Express',
        'sku'          => 'EXP',
        'sequence'     => '9999',
        'option_price' => '25.000'
    ]
]

But as you can see, the value Express only appear once, but user_value and status are removed too, because there value is 1, like id.