Tag Archives: wordwrap

Wrapping Text in PHP

wrapping text in php




Sometimes we need to wrap text to exactly accommodate a certain width of text or allowing browsers to wrap text whenever required. You can use PHP’s wordwrap() function to wrap a string into new lines when it reaches a specific length. This function limits text display to a particular column size, thereby allowing precise control over how text is rendered on a Web page. By default, wordwrap() wraps strings at column 75 using the standard newline sequence. Below example is […]