Пример #1
0
 /**
  * @param string $string
  * @param TransformationFormat $from
  * @param TransformationFormat $to
  * @return string
  */
 public static function convertString($string, TransformationFormat $from, TransformationFormat $to)
 {
     if ($from->equals($to)) {
         return $string;
     }
     $in = self::mapFormat($from);
     $out = self::mapFormat($to);
     return iconv($in, $out, $string);
 }