Jump to content

[SOLVED] Line Breaks in Textarea


limitphp

Recommended Posts

could you tell me how did you solve this problem? please share sample code pls.

also I need this but I didnt apply nl2br function:s

 

Here is a simple demo of how it could be used:

 

<?php
if ($_POST['action'] == 'Go Go Go') {
    $text = nl2br($_POST['foo']);
    // now do whatever you want with text, insert it into a database or display it to the user
}
?>
<html>
    <form method="post" action="">
        <textarea name="foo"></textarea>
        <input type="submit" name="action" value="Go Go Go" />
    </form>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.