This is a simple question; I will make it simple.
So I've got a <textarea name="textarea"> in a <form method="POST">
<?php
$textarea = $_POST['textarea'];
echo nl2br($textarea);
Solves maintaining the NEW LINES,
But how do I maintain TABS?
tab2tab() or something?
Although, not designed for this specific use, you can do:
$textarea = str_replace("\t", " ", $_POST['textarea']);
Or if you want the HTML equivalent of a space:
$textarea = str_replace("\t", " ", $_POST['textarea']);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With