Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

PHP wordwrap() issue


What_A_Legend's Avatar
...Legend?
0 0

I'm working on my new site and I'm currently having some difficulties with a wordwrap issue. I got a comment section on my page and the page layout can be messed up if they make the comment to big with out the uses of space's if you understand what I mean, I am trying to stop this with the worwrap function in PHP and it does not seem to be solving the issue at all.

Could any one look at this code and suggest any amendments.

        <?php echo $entry;
		$newentry = wordwrap( $text, 40 );
		echo "$newentry\n";?><br /><br />
        Posted on <?php echo $date; ?>```

Thank  You.

SySTeM's Avatar
-=[TheOutlaw]=-
20 0

What_A_Legend wrote: I'm working on my new site and I'm currently having some difficulties with a wordwrap issue. I got a comment section on my page and the page layout can be messed up if they make the comment to big with out the uses of space's if you understand what I mean, I am trying to stop this with the worwrap function in PHP and it does not seem to be solving the issue at all.

Could any one look at this code and suggest any amendments.

        <?php echo $entry;
		$newentry = wordwrap( $text, 40 );
		echo "$newentry\n";?><br /><br />
        Posted on <?php echo $date; ?>```

Thank  You.

```markup
<?php
echo $title . "</strong><br /><br />" . $entry;
$newentry = wordwrap( $text, 40, "<br />");
echo $newentry . "<br /><br /><br />
Posted on " . $date;
?>

Try that.


What_A_Legend's Avatar
...Legend?
0 0

Right i found another place were wordwrap() needs to be used.

Is it possible to add a word wrap of 50 chars to this code

markup print("<p>" . stripslashes ($row['comment']) . "</p>");


ghost's Avatar
0 0

markup print("<p>" . wordwrap(stripslashes ($row['comment']),50,"<br />",true) . "</p>";