I have two pages like this:
test.html
<!DOCTYPE html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
</head>
<body>
<form method="POST" action="test2.php">
<textarea id="input" name="input" cols="100px" rows="15" wrap="soft" placeholder="put input here"></textarea>
<button type="button" onclick="getLength()">Get length </button><p id="length"> </p></div>
<br >
<input type="submit">
</form>
<script>
function getLength(){
var len=$('textarea').val().length;
$('#length').text(len);
}
</script>
</body>
</html>
And test2.php
<?php
echo strlen($_POST['input']);
?>
When I enter some input eg: "aa[pressEnter]aa"
, It should echo 5 at test2.php page but it echoes 6 instead.
So why it is 6 (what is extra character) ?
thanks for reading!