我需要向許多用戶發送電子郵件通知。我遍歷並獲得用戶的電子郵件這樣的:如何將電子郵件格式化爲陣列 - Laravel 5.2
$userEmails = $favoriteGuides->map(function($relation){
return $relation->users->email;
});
,結果是這樣的:
Collection {#400 ▼
#items: array:3 [▼
0 => "[email protected]"
1 => "[email protected]"
2 => "[email protected]"
.... and so on
]
}
我需要那麼它進入一個數組格式化,所以我可以把它變成一個郵件功能。它需要像這樣格式化:
$emails = ["[email protected]", "[email protected]", "and so on..."];
我該如何格式化成我想要的結果?
我已經試過 - 內爆 - 但沒有得到我想要的結果。
是的,工作。謝謝! – David