DamienRoche Posted September 5, 2008 Share Posted September 5, 2008 I am trying to insert a <br> into a string after 12 characters and then continue the string. Does anybody know a simple way of doing this? I have tried but I can't even get the <br> to show, let alone operate as a tag.. Regards, Damien. Link to comment https://forums.phpfreaks.com/topic/122836-solved-substr_replace-help/ Share on other sites More sharing options...
lanmonkey Posted September 5, 2008 Share Posted September 5, 2008 try this: $mystring = "this is my stringstringstring, this is my stringstringstring, this is my stringstringstring"; //without word cut echo wordwrap($mystring, 12, "<br />\n"); echo "<br /><br />"; //with word cut echo wordwrap($mystring, 12, "<br />\n", TRUE); more info: http://uk3.php.net/manual/en/function.wordwrap.php Link to comment https://forums.phpfreaks.com/topic/122836-solved-substr_replace-help/#findComment-634387 Share on other sites More sharing options...
DamienRoche Posted September 5, 2008 Author Share Posted September 5, 2008 That is exactly what I needed. Thank you so much! Link to comment https://forums.phpfreaks.com/topic/122836-solved-substr_replace-help/#findComment-634738 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.