"; $typed = $_GET["whatwastyped"]; if (isset($typed)) echo json_encode($typed), " length: ", strlen($typed); foreach (explode("\r\n", $typed) as $line) { $line = json_encode($line); echo "
$line
"; }