Results 1 to 2 of 2

Thread: PHP string wraping

  1. #1
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Default PHP string wraping

    Hello,
    I have a script that emails me a form responce, But when the string was submitted, One long un-wraped line came up because the user never pressed enter, it just looked wraped. How (in php) can you add a new line after (lets say) 30 charaters and without disrupting a word so this doesn't happen:
    Code:
    Hello Joe,
    I thought you we
    re coming into to
    wn last weeken
    d? Oh well, catc
    h you later! By
    e!
    Thanks in advanced,
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

  2. #2
    Join Date
    May 2007
    Location
    England, UK
    Posts
    235
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Default

    use the wordwrap() function

    e.g.
    PHP Code:
    $text "users input";

    $message wordwrap($text30); 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •