I have a news headline grabbed from another page in the same site. The data
is captured like so:
$post=mysql_fetch_row($res2); $post=$post[0];
I then do a strlen analysis on $post, chop it off at $maxlen, and add
ellipses. This all works fine. The problem occurs if $post contains <pre>
data and the headline is chopped before the closing </pre> tag. The missing
</pre> ruins the page layout for everything that follows.
* The <pre> tag may or may not be present
* If <pre> is present, it may or may not be at the beginning of the string
I have looked at substr, strstr and strpos, but none of them seem to quite be
what I'm looking for. Advice please on how best to test for this.