UK [wə:d ræp] US [wɚd ræp]
n.Automatic line wrapping
php wordwrap() function syntax
How to use wordwrap() function?
The wordwrap() function means to wrap a string according to the specified length. The syntax is wordwrap(string,width,break,cut). If the function is successfully executed, the wrapped characters will be returned. String, or false if failed.
Function:Wrap the string according to the specified length
Syntax:wordwrap(string,width,break,cut)
Parameters:
Parameters | Description |
string | Required, specifies the string to be wrapped |
width | Optional, specifies the maximum line width, the default is 75 |
break | Optional, specifies the character used as a separator (string breaking character), the default is "\n". |
cut | Optional, specifies whether to wrap words larger than the specified width: false -- default, no-wrap. true -- wrap lines. |
Description: If the function is successfully executed, the wrapped string will be returned. If it fails, false will be returned.
php wordwrap() function example
Output:
I love programmin g. It's fun.
you can study php in php.cn