/ Published in: PHP
URL: http://www.adampatterson.ca/blog/2010/09/php-handy-little-snippet-for-multiline-text-box/
Expand |
Embed | Plain Text
<? // Get the message String $rawString = $_POST['comments']; // Split the string into pieces for processing // First element is the subject line $subject = $pieces[0]; // Take the array, delete the first entry, So we can pass it to $message // Replace the \n or add a <br /> if you like. echo "<br />"; ?> <textarea id="comments" name="comments">Your message</textarea> <input name="send" type="submit" value="Send" /> </form>
Comments
Subscribe to comments
You need to login to post a comment.

There is already a function called nl2br http://php.net/nl2br