I need to do a particular thing with a string...
Posted: Sun Apr 18, 2010 8:03 pm
Hi there, I'm currently building a site for a guy that tunes cars. I have some pages with thumbnails of the cars you click, and next to the thumbnail I have just a couple lines of it's specs (users click a link to see the full info on the car). Right now I'm in the middle of putting it all in a database, just to make it easier for me to edit or add new cars etc, but I don't want to store 2 different descriptions (long and short).
Basically I just want to cut down the full description on the thumbnails page and have it show only 6 lines. Can I make it chop the string after a certin amount of <br>'s? I have tried various functions but they usually just keep words intact or chop it to a certain character length. I need something that counts 6 <br>'s then chops it, this way the page looks neater
eg:
blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>
would become
blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>
Hope somebody can help...
Thanks
Basically I just want to cut down the full description on the thumbnails page and have it show only 6 lines. Can I make it chop the string after a certin amount of <br>'s? I have tried various functions but they usually just keep words intact or chop it to a certain character length. I need something that counts 6 <br>'s then chops it, this way the page looks neater
eg:
blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>
would become
blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>
Hope somebody can help...
Thanks