$way = array(a,b,c,d...); //массив с элементами $result = array(a => array(b,c,d), b => array(a,c,d),...); // что нужно получить
How can this be implemented in php?
<? $way = array(a,b,c,d); $result = array(); foreach($way as $i => $data1){ $result[$i] = array(); foreach($way as $j => $data2) if($i != $j) $result[$i][] = $j; } ?>
Source: https://ru.stackoverflow.com/questions/548500/More articles:How to stay within the C # arrayvalue in $ scope does not change when using the functionstream link and IPv6 networkHow to hang a handler on a button in a custom directiveAngular Material Why is md-card stretched to full screen and how can I specify the height?Bootstrap Dropdown Two buttons - the last one worksLinux Mint ProblemsInstalling Apche HttpClient in Intellij IdeaHow to distribute numbers from js arrayProblems with criteria query in hibernate [duplicate]All Articles