SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    May 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    deleting tags from string

    Hi,

    In my database I have a character field of 250 characters that contains text, including html tags ie <strong>

    Is there any way to delete the tags easily.

    I'm looping thru the records and only echoing the first 50 characters of the field. If there is a beginning tag (ex <strong>), but the ending tag </strong> is after the 50th character, the following record gets echo'd out in strong also.

    Ideally would be to delete a begining tag if the ending tag isn't in the first 50 caracters.

    TIA
    Patricia

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2007
    Posts
    154
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is this what you're looking for? strip_tags

  3. #3
    SitePoint Addict
    Join Date
    May 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    YES, that is it, thanks

    Quote Originally Posted by nicky77 View Post
    Is this what you're looking for? strip_tags


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
  •