Forum Moderators: coopster
However the new line before "-" you can do with:
$str = "And so she cried
- What are we goin' to do?";
$str = $str_replace("\n- ", "<br>- ", $str);// \n is a special character meaning the new line, which in html is <br>
However I myself would do that before placing the text into db (and letting, as it is done on this forum, to preview the text before submitting)
Hope this puts you in some direction
Michal Cibor
If yes, then do
$text = str_replace("\n", "\n<br>", $text);
what you want to do is hard to make. you can do:
for($i = 0; $i < strlen($text); $i + 51)
{
$text_corrected .= substr($text, $i, 50)."<br>";//you may have to check if it's not eating away one character
}
more on substr you can find at [php.net...]
Hope this helps
Michal Cibor
PS. This is a very bad and untidy method