Wordwrap in PHP - Php

wordwrap

Snippet Code


  
Rate this page :
  [ 0 votes]

Using wordwrap we can create line breaks in the given text by defining the length.

<?php $long_text = 'CHMOD comes as a set of 3 numbers. Each of these 3 numbers is a sum total of 3 other numbers. So you have to add 3 numbers to get the first CHMOD number, '; $long_text .= 'add 3 numbers to get the second CHMOD number'; $long_text .= ' and add 3 numbers to get the third CHMOD number.'; $new_text = wordwrap($long_text, 20, " n", true); print $new_text; ?>

Tags


Ask Questions

Ask Question