<?php $str = 'the quick brown fox jumps over the lazy dog.'; echo preg_replace('/the/', 'That', $str, 1); ?> - See more at: http://www.w3resource.com/php-exercises/php-string-exercises.php#sthash.nsXRqU7s.dpuf<?php
$text = "The quick brown fox jumped over the lazy dog.";
$newtext = wordwrap($text, 20, "<br />n");
echo $newtext;
?>