Created
January 30, 2017 15:27
-
-
Save mrcat323/aeeac0c4356b591f02522df02b49b4e9 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 | |
$arr = array( | |
0 => array("href" => "google.com", "text" => "Google"), | |
1 => array("href" => "ya.ru", "text" => "Yandex"), | |
2 => array("href" => "google.com", "text" => "Google RU"), | |
3 => array("href" => "google.com", "text" => "Google"), | |
); | |
$str = array(); | |
$some = array(); | |
foreach($arr as $key => $value) { | |
$some[$key] = $value["href"]; | |
} | |
$some = array_unique($some); | |
foreach($some as $key => $value) { | |
$str[$key] = $arr[$key]; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment