title: Merge/group array values to stop duplicated parents with exactly the same fullname
body: <pre><code>$temp = [];
  $array = [];
  
  $array[] = array("parent_id" =&gt; 1, "parent" =&gt; "Mr &amp; Mrs Lacey", "child_firstname" =&gt; "callum", "child_lastname" =&gt; "lacey");
  $array[] = array("parent_id" =&gt; 2, "parent" =&gt; "Mr and Mrs Lacey", "child_firstname" =&gt; "daniel", "child_lastname" =&gt; "lacey");
  $array[] = array("parent_id" =&gt; 3, "parent" =&gt; "Mr &amp; Mrs O'brian", "child_firstname" =&gt; "bruce", "child_lastname" =&gt; "O'brian");
  $array[] = array("parent_id" =&gt; 4, "parent" =&gt; "Mr &amp; Mrs Obrian", "child_firstname" =&gt; "dave", "child_lastname" =&gt; "O'brian");
  
  
  function stripString($input){
      $input = preg_replace("/[^a-zA-Z]+/", "", $input);
      return $input;
  }
  
  foreach($array as $item){
      $input = str_replace(" and ","", $item["parent"]);
      $parent = stripString($input);
      $child_firstname = stripString($item["child_firstname"]);
      $child_lastname = stripString($item["child_lastname"]);
      $temp[] = array("parent_id" =&gt; $item["parent_id"], 
                      "parent" =&gt; $parent, 
                      "child_firstname" =&gt; $child_firstname, 
                      "child_lastname" =&gt; $child_lastname);
  }
  </code></pre>
  
  <p>Print out: </p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [parent_id] =&gt; 1
              [parent] =&gt; MrMrsLacey
              [child_firstname] =&gt; callum
              [child_lastname] =&gt; lacey
          )
  
      [1] =&gt; Array
          (
              [parent_id] =&gt; 2
              [parent] =&gt; MrMrsLacey
              [child_firstname] =&gt; daniel
              [child_lastname] =&gt; lacey
          )
  
      [2] =&gt; Array
          (
              [parent_id] =&gt; 3
              [parent] =&gt; MrMrsObrian
              [child_firstname] =&gt; bruce
              [child_lastname] =&gt; Obrian
          )
  
      [3] =&gt; Array
          (
              [parent_id] =&gt; 4
              [parent] =&gt; MrMrsObrian
              [child_firstname] =&gt; dave
              [child_lastname] =&gt; Obrian
          )
  )
  </code></pre>
  
  <p>What I want to be able to print out: (needs to should the <code>duplicated_id</code>)</p>
  
  <pre><code>Array (
      [0] =&gt; Array  (
              [parent_id] =&gt; 1
              [duplicated_id] =&gt; 2
              [parent] =&gt; MrMrsLacey
              [0] =&gt; Array (
                  [child_firstname] =&gt; callum
                  [child_lastname] =&gt; lacey
              )
              [1] =&gt; Array (
                  [child_firstname] =&gt; daniel
                  [child_lastname] =&gt; lacey
              )
          )
  
      [1] =&gt; Array (
              [parent_id] =&gt; 3
              [duplicated_id] =&gt; 4
              [parent] =&gt; MrMrsObrian
              [0] =&gt; Array (
                  [child_firstname] =&gt; bruce
                  [child_lastname] =&gt; Obrian
              )
              [1] =&gt; Array (
                  [child_firstname] =&gt; dave
                  [child_lastname] =&gt; Obrian
              )
          )
  )
  </code></pre>