Hi, I'm trying to get a 500 character split of a string, I only want about the fist 500 characters, I would like to split on a space, which I have managed to do so far, but I would also like the split to not take place inside an HTML tag, so that I don't end up with weird looking pages.

I was trying to use strip_tags() error checking to tell me whether I my string was valid html or not. If it's not valid html then I would like to split before that part of the html begins. Possibly even as simply as removing the last 10 characters (to the nearest space) until I get valid HTML.

Can anyone help me get a way to split my text at around the 500 character mark without breaking any HTML which may be inside the string I am displaying on the page?

Also, if you're interested in the strip_tags() problem I was speaking about then take a look at: http://better.domain.name/php/strip.php there is a link to the source on the page.

Regards,
        Stuart Gilbert.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to