Re: Breaking a line in two
| From: | Ashley Sheridan | Date: | Sun, 17 Aug 2008 22:26:01 +0000 |
| Subject: | Re: Breaking a line in two | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-278253@lists.php.net to get a copy of this message | ||
Hi Ron,
This should do the trick:
<?php
$string = "The cat jumped up high.";
$pos = strpos($string, ' ', strlen($string)/2) + 1;
$new_string = substr_replace($string, '<br/>', $pos, 0);
?>
Ash
www.ashleysheridan.co.uk