I am using php to get textarea value using post method but getting a weird result with that let me show you my code
Use htmlspecialchars():
echo htmlspecialchars($_POST['contact_list']);
You can even improve your form processing by stripping all tags with strip_tags() and remove all white spaces with trim():
function processText($text) {
$text = strip_tags($text);
$text = trim($text);
$text = htmlspecialchars($text);
return $text;
}
echo processText($_POST['contact_list']);