Imploding Collections

Posted 9 months ago by xtremer360

I'm looking for a way that I can take a collection that contains groups of inner collections and imploding by the group but with the special characters on each group and then as well with the inner groups with a different text string.

If I take my grouped collection and run toArray() on it.

array:2 [
  0 => array:2 [
    0 => array:2 [
      "id" => 1
      "name" => "Player 1"
      ]
    ]
    1 => array:2 [
      "id" => 3
      "name" => "Player 2"
      ]
    ]
  ]
  1 => array:1 [
    0 => array:2 [
      "id" => 2
      "name" => "Player 3"
      ]
    ]
  ]
]

Final result:

Player 1 & Player 2 vs. Player 3

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.