以下示例仅显示表单数据的评估。
示例 #1 评估 FDF 文档
<?php
// 从扩展提供的输入字符串中打开 fdf
// pdf 表单包含几个名为
// volume、date、comment、publisher、preparer 的输入文本字段,以及两个复选框
// show_publisher 和 show_preparer。
$fdf = fdf_open_string($HTTP_FDF_DATA);
$volume = fdf_get_value($fdf, "volume");
echo "The volume field has the value '<b>$volume</b>'<br />";
$date = fdf_get_value($fdf, "date");
echo "The date field has the value '<b>$date</b>'<br />";
$comment = fdf_get_value($fdf, "comment");
echo "The comment field has the value '<b>$comment</b>'<br />";
if (fdf_get_value($fdf, "show_publisher") == "On") {
$publisher = fdf_get_value($fdf, "publisher");
echo "The publisher field has the value '<b>$publisher</b>'<br />";
} else
echo "Publisher shall not be shown.<br />";
if (fdf_get_value($fdf, "show_preparer") == "On") {
$preparer = fdf_get_value($fdf, "preparer");
echo "The preparer field has the value '<b>$preparer</b>'<br />";
} else
echo "Preparer shall not be shown.<br />";
fdf_close($fdf);
?>