We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

valcartei on 07/10/07


Tagged

layout wrap word-wrap


Versions (?)


Who likes this?

2 people have marked this snippet as a favorite

basicmagic
skywalker


word wrap


Published in: PHP 


URL: http://uk.php.net/manual/en/function.wordwrap.php

word-wrap refers to forcing the text to stay within its div, instead of extending to its length, which makes a div stretch. It is a built-in function in PHP, go to the url to see its descr in the PHP manual.

  1. string wordwrap ( string $str [, int $width [, string $break [, bool $cut]]] )
  2.  
  3. Here, I use <br> to break the string $string every 20 chars.
  4. i.e.wordwrap($string,20, "<br />\n")

Report this snippet 

You need to login to post a comment.