Availability in versions: PHP 4.0.2
Wraps a string to the specified number of characters
| Parameter | Data type | Default value | Note |
|---|---|---|---|
$str |
string |
not | String being processed. |
$width |
int |
75, | column width. |
$break |
string |
"\n", | The string is broken using the optional break parameter. |
$cut |
bool |
false | If the cut parameter is set to true, the string will always wrap at or before the specified width. Thus, if the word is larger than the specified width, it is split. (See the second example). |
string
The given string wrapped in the specified column.
Autor článku pracuje jako seniorní vývojář a software architekt v Praze. Navrhuje a spravuje velké webové aplikace, které znáte a používáte. Od roku 2009 nabral bohaté zkušenosti, které tímto webem předává dál.
Rád vám pomůžu:
Nejlepsi tipy a triky o PHP do Vaseho e-mailu. Clanky a novinky nejen ze sveta PHP a programovani.