|
|
Tutorials » Php »
|
Topic |
What is wordwrap Function?
|
|
Explanation |
|
In PHP this function is used to write a formatted string to a stream.
Syntax:
wordwrap(string,width,break,cut)
In the above syntax "string" specifies the string to break up into lines, "width" specifies maximum line width,
"break" specifies the character to use as break, "cut" specifies whether words longer than the specified width should
be wrapped.
Example:
<?php
$str = "An example on a long word is: Supercalifragulistic";
echo wordwrap($str,15);
?>
Result:
An example on a long word is: Supercalifragulistic
In the above wordwrap Function example the output is displayed according to the width specified.
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|