I have a page that displays the first 150 characters from a database field and then '.....[more]'. This information from the database includes html tags. The trouble is that the 150 sometimes falls mid tag so i am left with something like -
<opening tag>lots of text, 150 characters to be exact<closeing ta
which then throws the rest of my page. I thought the best way to get around this was to use a reg exp that does 'get 1st 150 characters, ignoring everything between < and >'
Is this best, if so how do I do it?!!
<opening tag>lots of text, 150 characters to be exact<closeing ta
which then throws the rest of my page. I thought the best way to get around this was to use a reg exp that does 'get 1st 150 characters, ignoring everything between < and >'
Is this best, if so how do I do it?!!
Comment