Jump to content

kermy

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

kermy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have some strings that contain fairly simply html code, for example: "<p>This is the <b>first paragraph</b></p><p> this is the second</p>" The tags are generally limited to things like <p>, <b>, <u>, <em> etc. I'd like to be able to 'preview' this string to the user by only showing the first line. In the above code, for example, '<p>This is the <b>first paragraph</b></p>'. If it was plain text, I'd just use substr to get say the first 80 characters, but with the html formatting some of the characters will be hidden since they are mark-up. There's also the problem that the substring might not contain balanced tags, eg "<p>This is the <b>first paragraph<" Any ideas how I'd do this? Perhaps the solution is not PHP, but somehow to use overlapping <div> to hide all the but first line?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.