gpt4 book ai didi

php - 如何使用 PEAR 和 PHP 创建表?

转载 作者:搜寻专家 更新时间:2023-10-31 21:38:22 26 4
gpt4 key购买 nike

<分区>

您好,我正在使用以下代码来显示表格,但它显示了这样的错误。

Warning: require(HTML/Table.php) [function.require]: failed to open stream: No such file or directory in /home/aspire/public_html/table.php on line 3

Fatal error: require() [function.require]: Failed opening required 'HTML/Table.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/aspire/public_html/table.php on line 3

这是我的代码。谁能告诉我我做错了什么。

 require("HTML/Table.php");
$tableStyle = array("bgcolor"=>"#FFFFFF", "border"=>"1", "width"=>"150", "cellpadding"=>"1", "cellspacing"=>"2");
$colA = array("field 1", "field 2", "field 3", "", "<b>TOTAL</b>");
$a = 10;
$b = 15;
$c = 8;
$total = $a+$b+$c;
$colB = array($a, $b, $c, "", "<b>".$total."</b>");
$table = new HTML_Table($tableStyle);
$table->addCol($colA);
$table->addCol($colB);
$table->display();

使用这个“php go-pear.phar”命令我找到了以下路径。

Current include path           : .:/usr/share/php:/usr/share/pear
Configured directory : /home/aspire/pear/share/pear
Currently used php.ini (guess) : /etc/php5/cli/php.ini

所以当在开始我的代码之前指定路径时

 include_path=".:/usr/share/php:/usr/share/pear/";

它显示了这样的错误

Parse error: syntax error, unexpected '=' in /home/aspire/public_html/table.php on line 2

如何解决这个问题。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com