By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,723 Members | 1,414 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,723 IT Pros & Developers. It's quick & easy.

Closing HTML tags.

P: n/a
LPA
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
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"LPA" <lp*@numericable.fr> wrote in message
news:3f*********************@nnrp1.numericable.fr. ..
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

.


Close the tags

Regards
Richard Grove
http://shopbuilder.org - ecommerce systems
Become a Shop Builder re-seller:
http://www.affiliatewindow.com/affil...ls.php?mid=611
http://www.affiliatewindow.com/a.pl?590
Jul 17 '05 #2

P: n/a
LPA wrote:
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


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.

Jul 17 '05 #3

P: n/a
LPA
> Close the tags

Regards
Richard Grove


Thanx for the suggestion ;))))))))
Jul 17 '05 #4

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

Many thnx

LPA

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.

Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.