Index: trunk/extensions/Babel/codes/ISO_639_1.php |
— | — | @@ -564,4 +564,21 @@ |
565 | 565 | 'zu' => array( |
566 | 566 | ISO_639_3 => 'zul', |
567 | 567 | ), |
568 | | -); |
\ No newline at end of file |
| 568 | +); |
| 569 | + |
| 570 | + |
| 571 | +function get1to3() { |
| 572 | + global $codes; |
| 573 | + return $codes; |
| 574 | +} |
| 575 | + |
| 576 | +function get3to1() { |
| 577 | + global $codes; |
| 578 | + $codes3to1=array(); |
| 579 | + foreach ($codes as $code1=>$codes3) { |
| 580 | + foreach($codes3 as $code3) { |
| 581 | + $codes3to1[$code3]=$code1; |
| 582 | + } |
| 583 | + } |
| 584 | + return $codes3to1; |
| 585 | +} |
Index: trunk/extensions/Babel/codes/testconvert.php |
— | — | @@ -0,0 +1,6 @@ |
| 2 | +<?php |
| 3 | +require_once("ISO_639_1.php"); |
| 4 | +var_dump(get3to1()); |
| 5 | +var_dump(get1to3()); |
| 6 | + |
| 7 | +?> |