• PHP Video Tutorials

PHP - Function Wordwrap



Syntax

wordwrap(string,width,break,cut)

Definition and Usage

It used to convert the long words to be broken and its arrange to the next line

Return Values

It returns string broken into the lines or else false on failure

Parameters

Sr.No Parameters & Description
1

String

It is used to specifies string broken lines

2

width

It is used to specifies the max number of lines width

3

break

It is used to specifies special characters that used to break

4

cut

It is used to specifies whether words longer than the specifies width should be broken

Example

Try out the following example

<?php
   $str = "tutorials point:simply easy learning";
   echo wordwrap($str,15,"<br>\n",TRUE);
?>

This will produce following result −

tutorials
point:simply
easy learning
php_function_reference.htm
Advertisements