это мой массив, и я пытаюсь отправить навыки работы с электронной почтой пользователя, но электронная почта повторяется,
[email protected] | Angular JS
[email protected] | JQuery
[email protected] | Linux
[email protected] | JQuery
[email protected] | Angular JS
[email protected] | JQuery
[email protected] | Angular JS
[email protected] | Linux
[email protected] | Microsoft Dot Net
[email protected] | Angular JS
но я хочу разделить массив как заказ по email-id
[email protected] | {Angular JS, JQuery}
[email protected] | {Linux, JQuery, Angular JS}
[email protected] | {JQuery, Angular JS}
[email protected] | {Linux, Microsoft Dot Net, Angular JS}
помогите, спасибо заранее...
Чтобы быть точным: вы хотите "сгруппировать", а не "сортировать" Вот пример:
$newArray = [];
foreach($your_array as $row){
// [0] gets email, [1] gets skill
$newArray[$row[0]][] = $row[1];
}
ksort($newArray);