PHP wordwrap; although it may be temping

although it may sound like a good idea to use php's wordwrap() for user comments+, use css to control long strings

<?php
// from database, already sanitized
$comment = <<<EOF
this is a reallllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllyyyyyyyyyyyyy long comment that will break the layout..........................................................................................................................................................................................
EOF;
echo 
    '<div class="comment">' .
        $comment .
    '</div>' .
    '';
.comment {
    overflow-x: auto;
}
Did this help you? Please let me know with a comment. Thank you
Posted .

Comments (RSS)

Leave a comment