[ create a new paste ] login | about

Link: http://codepad.org/CtRjRmjJ    [ raw code | output | fork ]

PHP, pasted on Dec 4:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
$test = array("meh" => 5,
              "awesome" => 3,
              "is in" => 5,
              "stuff" => 3,
              "ich" => 4,
              "da house" => 5,
              "bin mude" => 4);

$out = array();
foreach($test as $key=>$value)
    if(array_key_exists($value, $out))
         $out[$value] .= $key.' ';
    else
         $out[$value] = $key.' ';

foreach($out as $item)
   echo trim($item).'<br />';
?>


Output:
1
meh is in da house<br />awesome stuff<br />ich bin mude<br />


Create a new paste based on this one


Comments: