Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Aug 2009
    Thanked 7 Times in 7 Posts

    Forcing wordwrap() to ignore HTML tags


    Yesterday I received help regarding the functino wordwrap(). It's good but after a bit I noticed it wraps HTML tags too.

    Like, I have a long sentence which includes <b></b>, some font color styling etc. and it gets messed up when it adds in a space between. (I.e. </f ont>, < /b> etc.)

    Then I researched it a bit and found some people posting their custom wordwrap function which ignores HTML tags, but apparently some letters are missing, when I output my string.

    Does anyone have an idea of how I could do this?

    EDIT: I just found this: http://php.net/manual/en/function.wordwrap.php#89782
    Apparently it works fine for me at this point, although there's a notice about an issue in the script.

    Considering everything works as it should right now, my issue is resolved. But if anyone knows anything about it, please tell me.
    Last edited by [vengeance]; 10-11-2009 at 06:10 PM.


Posting Permissions

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