1){ $text = ''; foreach($texts as $t){ $text.= self::pad(trim($t), $pad_string, $pad_type)."\n"; } return $text; }else{ return str_pad(trim($text), $cols, $pad_string, $pad_type); } } public static function pads($textLeft, $textRight, $pad_string = ' '){ global $config; $cols = 37; if($config['printer_cols']){ $cols = $config['printer_cols']; } return $textLeft.str_pad($textRight, $cols-strlen($textLeft), $pad_string, 0); } }