-
-
Save anonymous/440fd951e8b46c4a64cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = Array( | |
Array('сало', 'красное'), | |
Array('сало', 'зеленое'), | |
Array('сало', 'голубое'), | |
); | |
$b = Array(); | |
foreach ($a as $row) { | |
$b[$row[0]][] = $row[1]; | |
} | |
foreach ($b as &$item) { | |
$item = implode($item, ','); | |
} | |
var_dump($b); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment