html网页中php提交表单与取值代码
的有关信息介绍如下:
提交表单后php处理出来的页面。在这个例子中,我输入一个单词,然后给定一个长度,将单词等分成该长度的块。
这两天学了写表单。总结于此,以备忘。
例子一(POST提交表单):
view sourceprint?
Chunkify Form
view sourceprint?
Chunkify Word
$word=$_POST['word'];
$number=$_POST['number'];
$chunks=ceil(strlen($word)/$number);
echo "The $number-letter chunks of '$word' are:
n";
for ($i = 0;$i<$chunks;$i++){
$chunk=substr($word,$i*$number,$number);
printf("%d: %s
n",$i+1,$chunk);
}
?>
