SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,380
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Outputting field without the HTML tags

    Right now I don't use HTML in my fields, so when I output the tables to Excel, they are clean and easy to read. Now I'd like to start adding simple HTML to the fields. (For instance, the <strong> and <em> tags.)

    When I put it on a page to be opened as an Excel document, how do I indicate that all tags are to be removed? I'm sure regex would be used, but after a bit of studying, I still can't figure out the proper syntax.

    Any help will be appreciated!

  2. #2
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,380
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Extra Note:

    Assume that I will not be matching specific tags, but I should be able to match anything within the < and > that appear. That will give me a lot of flexibility.

  3. #3
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    strip_tags()

  4. #4
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,380
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hmmm ... It appears that exporting to Excel does not export the tags anyway. Without strip_tags() the tags are active (the <strong> type echos as "bold") but the HTML tags themselves do not appear. I worried for nothing!

    Thanks for the 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
  •