GepComty

Untitled

Feb 4th, 2014
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. <?php
  2. $a= Array
  3. (
  4. "RT III" => 3,
  5. "RT II" => 2,
  6. "RT I" => 2,
  7. "RT V" => 1,
  8. "RT IV" => 1
  9. );
  10. foreach ($a as $key => $value) {
  11. if($value==next($value)){
  12. $c= next($key);
  13. $h = implode(",", $c);
  14. }else{
  15. $h = $key;
  16. }
  17. $r[] = $h;
  18. }
  19.  
  20. echo "<pre>";
  21. print_r($a);
  22. echo"</pre>";
  23. echo "<pre>";
  24. print_r($r);
  25. echo"</pre>";
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment