compress.php

来自「Ajax最流行书籍」· PHP 代码 · 共 38 行

PHP
38
字号
<form action="compress.php" method="post"><?php$data = '';if (array_key_exists('data', $_POST)) {	$postData = explode("\n", trim($_POST['data']));	foreach ($postData as $line) {		$line = preg_replace('/\t+/i', ' ', $line);		$line = trim($line);		if (strlen($line) < 1) {			continue;		}		$data .= $line . "\n";	}	$data = trim($data);}?>	<p>		<textarea rows="25" cols="100" name="data" style="border: 0.1em solid #ccc; padding: 1em;"><?= htmlspecialchars($data) ?></textarea>		<script type="text/javascript">		document.getElementsByName('data')[0].focus();		document.getElementsByName('data')[0].select();		</script>	</p>	<p>		<input type="submit" value="Compress" style="font: bold 0.7em tahoma, verdanam, arial, serif;" />	</p></form>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?