Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Posts
    5

    Question Unanswered: Selectively formatting form contents

    I'm working on a movie database, and one of the forms contains a semicolon-delimited list of alternative titles for the film in question. I'd like to make the list more readable somehow, but I'm not sure how to go about it (without putting markup in the database itself, of course). How easily could PHP replace the semicolon with a line break? I think that would be ideal.

    If all else fails I guess I could use <pre>, but I'd like a more elegant, controlllable solution.

  2. #2
    Join Date
    Feb 2003
    Posts
    5

    Arrow Re: Selectively formatting form contents

    For those interested, I solved this problem myself very simply and without additional PHP. I changed the semicolons to line breaks, then processed the output with CSS thusly:

    <p style="white-space: pre;"><i><? echo database call ?></i></p>

    By rendering white-spaces and linebreaks the same way as <pre> without actually using <pre>, linebreaks are preserved without disrupting layout design and text flow; the output is formatted appropriately for the content, and it's nice and readable.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •