Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php “一词;(数组)“;正在我的表中打印,而不是在实际对象数组中打印_Php_Html_Arrays_Html Table - Fatal编程技术网

Php “一词;(数组)“;正在我的表中打印,而不是在实际对象数组中打印

Php “一词;(数组)“;正在我的表中打印,而不是在实际对象数组中打印,php,html,arrays,html-table,Php,Html,Arrays,Html Table,所有代码都在同一个索引文件和同一个类中。我似乎不明白为什么不打电话。这两个对象本身都在调用中工作,位于该表的正上方2-3行中。。。。我试着把他们叫到桌子里面,但没有用。它们只是在两个框中弹出单词“(数组)”。它们是我缺少的一种句法吗?在我的网站上,我打印了表格,表格内有缺失的功能,而应该在表格内的两个表格则打印在表格的正上方和下方。作为参考,我的学校项目网站: 我想我注意到了这个问题: <?php print "<TABLE style='width:100%'height=200

所有代码都在同一个索引文件和同一个类中。我似乎不明白为什么不打电话。这两个对象本身都在调用中工作,位于该表的正上方2-3行中。。。。我试着把他们叫到桌子里面,但没有用。它们只是在两个框中弹出单词“(数组)”。它们是我缺少的一种句法吗?在我的网站上,我打印了表格,表格内有缺失的功能,而应该在表格内的两个表格则打印在表格的正上方和下方。作为参考,我的学校项目网站:


我想我注意到了这个问题:

<?php

print "<TABLE style='width:100%'height=200 BORDER='1'>
<TR><TD style='width:15%'>$companyobject->getLeftNavBar($companyobject->navbar_array)
</TD>
<TD>$companyobject->displayProduct($companyobject->burger_array)
</TD></TR>
</TABLE>";

如果使用:print_r($companyobject);,结果如何?结果是阵列的转储。。。。检查表格下的网站,查看问题中是否可以使用函数displayProduct进行编辑?使用函数进行编辑?在您的问题中包括您使用的函数的代码。两个调用以不同的样式进行,一个是使用对象传递参数,另一个是使用对象。。。。这是教授试图教它的方式。有3节课在3个不同的文件中。。。。。Index.php、Company.php和BurgerJoint.php。。。。。。。。。。。Burgerjoint从公司继承并导入文件。。。。。索引是我的主文件,它导入BurgerJoint并从中创建对象。此外,如果您再次查看网站,我在表的正上方取消了对代码的注释,这表明表中的相同调用在表外工作,用于我要放在表内的两个对象table@WallofKron请注意,如果您使用的是对象,那么oop中最常用的编程方式不是传递所有数据,而是将类内的信息私有化并创建返回正确值的函数。
<?php

print "<TABLE style='width:100%'height=200 BORDER='1'>
<TR><TD style='width:15%'>$companyobject->getLeftNavBar($companyobject->navbar_array)
</TD>
<TD>$companyobject->displayProduct($companyobject->burger_array)
</TD></TR>
</TABLE>";
<!DOCTYPE html>
<html>
    <head>
        <title>Bob's Burgers</title>
    </head>
    <body>
        <header style="background:orange; width:100%;">
            <div style="text-align:center;">
                <?php foreach($companyobject->navbar_array as $nav){
                     echo $nav
                }?>
        </header>
        <main style="width:100%;">
            <table style="height:200px; border:1px solid black;">
                <?php foreach($companyobject->burger_array as $burger):?>
                    <tr><td><?php echo $burger; ?></td></tr>
                <? endforeach; ?>
            </table>
         </main>
</html>