wordwrap
thermage/thermage
Supported Versions: PHP 4 >= 4.0.2, PHP 5, PHP 7, PHP 8
Wraps a string to a given number of characters
wordwrap
(
string $string
,
int $width
=
75
,
string $break
=
"\n"
,
bool $cut_long_words
=
false
):
string
if (
$this
->
styles
->
has
(
'font'
)) {
$lines
=
explode
(
PHP_EOL
,
$this
->
value
);
} else {
$lines
=
explode
(
PHP_EOL
,
strings
(
wordwrap
(
$this
->
value
,
terminal
()->
getWidth
() -
$pr
-
$pl
-
$mr
-
$ml
- (
$hasBorder
() ?
$borderSpaces
:
0
) +
$this
->
getShortcodesStringSize
(
$this
->
value
),
PHP_EOL
,
false
))->
trimRight
(
PHP_EOL
)->
toString
());
}
}
src/Base/Element.php
if (
$this
->
styles
->
has
(
'font'
)) {
$lines
=
explode
(
PHP_EOL
,
$this
->
value
);
} else {
$lines
=
explode
(
PHP_EOL
,
strings
(
wordwrap
(
$this
->
value
,
terminal
()->
getWidth
() -
$pr
-
$pl
-
$mr
-
$ml
- (
$hasBorder
() ?
$borderSpaces
:
0
) +
$this
->
getShortcodesStringSize
(
$this
->
value
),
PHP_EOL
,
false
))->
trimRight
(
PHP_EOL
)->
toString
());
}
}
src/Base/Element.php
if (
$this
->
styles
->
has
(
'font'
)) {
$lines
=
explode
(
PHP_EOL
,
$this
->
value
);
} else {
$lines
=
explode
(
PHP_EOL
,
strings
(
wordwrap
(
$this
->
value
,
terminal
()->
getWidth
() -
$pr
-
$pl
-
$mr
-
$ml
- (
$hasBorder
() ?
$borderSpaces
:
0
) +
$this
->
getShortcodesStringSize
(
$this
->
value
),
PHP_EOL
,
false
))->
trimRight
(
PHP_EOL
)->
toString
());
}
}
src/Base/Element.php
if (
$this
->
styles
->
has
(
'font'
)) {
$lines
=
explode
(
PHP_EOL
,
$this
->
value
);
} else {
$lines
=
explode
(
PHP_EOL
,
strings
(
wordwrap
(
$this
->
value
,
$widthStyle
-
$pr
-
$pl
- (
$hasBorder
() ?
$borderSpaces
:
0
) +
$this
->
getShortcodesStringSize
(
$this
->
value
),
PHP_EOL
,
false
))->
trimRight
(
PHP_EOL
)->
toString
());
}
}
src/Base/Element.php
if (
$this
->
styles
->
has
(
'font'
)) {
$lines
=
explode
(
PHP_EOL
,
$this
->
value
);
} else {
$lines
=
explode
(
PHP_EOL
,
strings
(
wordwrap
(
$this
->
value
,
$widthStyle
-
$pr
-
$pl
- (
$hasBorder
() ?
$borderSpaces
:
0
) +
$this
->
getShortcodesStringSize
(
$this
->
value
),
PHP_EOL
,
false
))->
trimRight
(
PHP_EOL
)->
toString
());
}
}
src/Base/Element.php
if (
$this
->
styles
->
has
(
'font'
)) {
$lines
=
explode
(
PHP_EOL
,
$this
->
value
);
} else {
$lines
=
explode
(
PHP_EOL
,
strings
(
wordwrap
(
$this
->
value
,
$widthStyle
-
$pr
-
$pl
- (
$hasBorder
() ?
$borderSpaces
:
0
) +
$this
->
getShortcodesStringSize
(
$this
->
value
),
PHP_EOL
,
false
))->
trimRight
(
PHP_EOL
)->
toString
());
}
}
src/Base/Element.php