新人提问:竟然输出一片空白
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh" xml:lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Jazz Legends - Miles Davis</title>
</head>
<body>
<form action="index.php" method="post">
<p>
Provide up to six keywords that you believe best describe the state in
which you live:
</p>
<p>
Keyword 1:<br />
<input type="text" name="keyword[]" size="20" maxlength="20" value=""/>
</p>
<p>
Keyword 2:<br />
<input type="text" name="keyword[]" size="20" maxlength="20" value=""/>
</p>
<p>
Keyword 3:<br />
<input type="text" name="keyword[]" size="20" maxlength="20" value=""/>
</p>
<p>
Keyword 4:<br />
<input type="text" name="keyword[]" size="20" maxlength="20" value=""/>
</p>
<p>
Keyword 5:<br />
<input type="text" name="keyword[]" size="20" maxlength="20" value=""/>
</p>
<p>
Keyword 6:<br />
<input type="text" name="keyword[]" size="20" maxlength="20" value=""/>
</p>
<p><input type="submit" value="Submit!"/></p>
</form>
</body>
</html>
index.php:
<?php
function sanitize_data(&$value, $key) {
$value = strip_tags($value);
}
array_walk($_POST['keyword'], "sanitize_data");
?>
输入数据后提交转到index.php输出竟然一片空白。。。。为什么呢?完全不关单引号双引号的事!
[解决办法]
是不是要加个echo