Closing HTML tags.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • LPA

    Closing HTML tags.

    Hi,

    I have a function to take the 300 first words of a db field. As this field
    contains HTML, if some tags are not closed (TABLE, TD, TR, SPAN, DIV, P,
    ....) the presentation is out.

    Is someone have a solution ?

    Thanx

    LPA


  • Richard Grove

    #2
    Re: Closing HTML tags.

    "LPA" <lpa@numericabl e.fr> wrote in message
    news:3faf541b$0 $243$a3f2974a@n nrp1.numericabl e.fr...[color=blue]
    > Hi,
    >
    > I have a function to take the 300 first words of a db field. As this field
    > contains HTML, if some tags are not closed (TABLE, TD, TR, SPAN, DIV, P,
    > ...) the presentation is out.
    >
    > Is someone have a solution ?
    >
    > Thanx
    >
    > LPA
    >
    > .[/color]

    Close the tags

    Regards
    Richard Grove


    http://shopbuilder.org - ecommerce systems
    Become a Shop Builder re-seller:
    Affiliate marketing is a simple way to earn money online, using our affiliate platform. Join a global community of publishers and advertisers.

    Affiliate marketing is a simple way to earn money online, using our affiliate platform. Join a global community of publishers and advertisers.



    Comment

    • Martin Meredith

      #3
      Re: Closing HTML tags.

      LPA wrote:[color=blue]
      > Hi,
      >
      > I have a function to take the 300 first words of a db field. As this field
      > contains HTML, if some tags are not closed (TABLE, TD, TR, SPAN, DIV, P,
      > ...) the presentation is out.
      >
      > Is someone have a solution ?
      >
      > Thanx
      >
      > LPA
      >
      >[/color]

      I normally make an array of tags that i open, and just remove them as I
      close them, then any that are still open I can just call a foreach to
      close them.

      Though this might not be ideal for you.

      Another way of doing might be to store your output in a buffer, and
      before you output it, run it through an XML processor and check for errors.

      Comment

      • LPA

        #4
        Re: Closing HTML tags.

        > Close the tags[color=blue]
        >
        > Regards
        > Richard Grove[/color]

        Thanx for the suggestion ;))))))))


        Comment

        • LPA

          #5
          Re: Closing HTML tags.

          Thats whats I was thinking.. Having an index array : tag=>count..
          I think i'll try this

          Many thnx

          LPA

          [color=blue]
          > I normally make an array of tags that i open, and just remove them as I
          > close them, then any that are still open I can just call a foreach to
          > close them.
          >
          > Though this might not be ideal for you.
          >
          > Another way of doing might be to store your output in a buffer, and
          > before you output it, run it through an XML processor and check for[/color]
          errors.[color=blue]
          >[/color]


          Comment

          Working...