Re: cut off a string?



<dev> wrote in message
news:42c3a3ae$0$2967$e4fe514c@xxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hey all,
>
> I have a small CMS tool that users can leave a max 200 characters message.
>
> everthing is fine but IF someone does something like this:
>
> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> 200 characters long
>
> my whole layout bearks appart even when i use style="width:300px" etc
>
> so is there a premade function in php that splits my words?
>
>
> Cheers,
>
> D
>

FOUND !! :))

$text=wordwrap($text, 50, "<br />\n",1);

notice the 1 at the end that is important so he looks now also in long words
without \s

D



.



Relevant Pages

  • Re: cut off a string?
    ... > Hey all, ... > I have a small CMS tool that users can leave a max 200 characters message. ... > everthing is fine but IF someone does something like this: ...
    (comp.lang.php)
  • Re: cut off a string?
    ... > Hey all, ... > I have a small CMS tool that users can leave a max 200 characters message. ... > everthing is fine but IF someone does something like this: ...
    (comp.lang.php)
  • cut off a string?
    ... Hey all, ... I have a small CMS tool that users can leave a max 200 characters message. ... everthing is fine but IF someone does something like this: ...
    (comp.lang.php)