public static function wrap($text, $left_margin = 0, $right_margin = 0,
        $width = null)
    {
        if (empty($width)) {
            $width = self::getWidth();
        }
        $width = $width - abs($left_margin) - abs($right_margin);
        $margin = str_repeat(' ', $left_margin);
        return $margin . wordwrap($text, $width, PHP_EOL . $margin);
    }
public static function wrap($text, $left_margin = 0, $right_margin = 0,
        $width = null)
    {
        if (empty($width)) {
            $width = self::getWidth();
        }
        $width = $width - abs($left_margin) - abs($right_margin);
        $margin = str_repeat(' ', $left_margin);
        return $margin . wordwrap($text, $width, PHP_EOL . $margin);
    }
public static function wrap ( $ text , $ left_margin = 0 , $ right_margin = 0 , $ width = null ) { if ( empty ( $ width ) ) { $ width = self :: getWidth ( ) ; } $ width = $ width - abs ( $ left_margin ) - abs ( $ right_margin ) ; $ margin = str_repeat ( ' ' , $ left_margin ) ; return $ margin . wordwrap ( $ text , $ width , PHP_EOL . $ margin ) ; }
Wrap text for printing
@param string $text
@param int $left_margin
@param int $right_margin
@param int $width attempts to use current terminal width by default
@return string
Wrap text for printing