问题包括其他php文件。 [英] Problem including the other php file.

查看:67
本文介绍了问题包括其他php文件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想在index.php文件中包含三个php文件,如下面的代码所示。但

它总是只显示两个,三个中的任意两个,任何订单。


< tr>

< ; td><?php include(" includes / documents.php"); ?>& nbsp;< / td>

< / tr>

< tr>

< td>< ;?php include(includes / locations.php); ?>& nbsp;< / td>

< / tr>

< tr>

< td>< ;?php include(includes / status.php); ?>& nbsp;< / td>

< / tr>


任何人都可以帮助我吗?

Ben

Hi,

I want to include three php files in index.php file like the code below. But
it always shows up only two, any two of the three, any order.

<tr>
<td><?php include ("includes/documents.php"); ?>&nbsp;</td>
</tr>
<tr>
<td><?php include ("includes/locations.php"); ?>&nbsp;</td>
</tr>
<tr>
<td><?php include ("includes/status.php"); ?>&nbsp;</td>
</tr>

Can anyone help me out?

Ben

推荐答案

6月8日上午11:07,Ben Sehara < seh ... @ hotmail.comwrote:
On Jun 8, 11:07 am, "Ben Sehara" <seh...@hotmail.comwrote:




我想在索引中包含三个php文件.php文件,如下面的代码。但

它总是只显示两个,三个中的任意两个,任何订单。


< tr>

< ; td><?php include(" includes / documents.php"); ?< / td>

< / tr>

< tr>

< td><?php include(" ;包括/ locations.php"); ?< / td>

< / tr>

< tr>

< td><?php include(" ;包括/ status.php"); ?< / td>

< / tr>


任何人都可以帮帮我吗?


Ben
Hi,

I want to include three php files in index.php file like the code below. But
it always shows up only two, any two of the three, any order.

<tr>
<td><?php include ("includes/documents.php"); ?</td>
</tr>
<tr>
<td><?php include ("includes/locations.php"); ?</td>
</tr>
<tr>
<td><?php include ("includes/status.php"); ?</td>
</tr>

Can anyone help me out?

Ben



嗨Ben,

include()语句与require()的工作方式相同,

的区别是require()在语句第一次执行
时被执行,而每次语句执行时都会清除include()。

执行。


你可能想以这种方式工作:


<?php


if(variable == true )

{

include(''file.inc'');

}

else

{

echo''你好!'';

}

?>


再见,

V.

Hi Ben,
the include() statement works in the same way of require(), with the
difference that require() is executed the first time the statement is
parsed, while include() is evluated each time the statement is
executed.

you may wanna work in this way:

<?php

if (variable == true)
{
include(''file.inc'');
}
else
{
echo ''hello!'';
}
?>

bye,
V.


6月8日上午11:30,vinnie< centro.ga ... @ gmail.comwrote:
On Jun 8, 11:30 am, vinnie <centro.ga...@gmail.comwrote:

6月8日上午11:07,Ben Sehara < seh ... @ hotmail.comwrote:
On Jun 8, 11:07 am, "Ben Sehara" <seh...@hotmail.comwrote:


Hi,


I想在index.php文件中包含三个php文件,如下面的代码所示。但

它总是只显示两个,三个中的任意两个,任何订单。
I want to include three php files in index.php file like the code below. But
it always shows up only two, any two of the three, any order.


< tr>

< td><?php include(" includes / documents.php" ); ?< / td>

< / tr>

< tr>

< td><?php include(" ;包括/ locations.php"); ?< / td>

< / tr>

< tr>

< td><?php include(" ;包括/ status.php"); ?< / td>

< / tr>
<tr>
<td><?php include ("includes/documents.php"); ?</td>
</tr>
<tr>
<td><?php include ("includes/locations.php"); ?</td>
</tr>
<tr>
<td><?php include ("includes/status.php"); ?</td>
</tr>


任何人都可以帮帮我吗?
Can anyone help me out?


Ben
Ben



嗨Ben,

包括()语句与require()的工作方式相同,

的区别是require()在语句第一次执行时被执行
解析,而include()每次声明执行时都会被清除。


Hi Ben,
the include() statement works in the same way of require(), with the
difference that require() is executed the first time the statement is
parsed, while include() is evluated each time the statement is
executed.



嗯,不完全。 require()和include()在各方面都是相同的

除了它们如何处理失败。如果由于某种原因无法包含文件

,则require()将导致整个脚本死亡,而

include只会发出警告。

Umm, not quite. require() and include() are identical in every way
except for how they handle failure. If the file cannot be included
for some reason, require() will cause the entire script to die while
include will just throw a warning.


6月8日上午11:38,ZeldorBlat< zeldorb ... @ gmail.comwrote:
On Jun 8, 11:38 am, ZeldorBlat <zeldorb...@gmail.comwrote:

6月8日上午11:30,vinnie< centro.ga ... @ gmail.comwrote:
On Jun 8, 11:30 am, vinnie <centro.ga...@gmail.comwrote:

6月8日上午11点07分, Ben Sehara < seh ... @ hotmail.comwrote:
On Jun 8, 11:07 am, "Ben Sehara" <seh...@hotmail.comwrote:



Hi,


我想在index.php文件中包含三个php文件,如下面的代码所示。但

它总是只显示两个,三个中的任意两个,任何订单。
I want to include three php files in index.php file like the code below. But
it always shows up only two, any two of the three, any order.


< tr>

< td>< ?php include(includes / documents.php); ?< / td>

< / tr>

< tr>

< td><?php include(" ;包括/ locations.php"); ?< / td>

< / tr>

< tr>

< td><?php include(" ;包括/ status.php"); ?< / td>

< / tr>
<tr>
<td><?php include ("includes/documents.php"); ?</td>
</tr>
<tr>
<td><?php include ("includes/locations.php"); ?</td>
</tr>
<tr>
<td><?php include ("includes/status.php"); ?</td>
</tr>


任何人都可以帮助我吗?
Can anyone help me out?


Ben
Ben


嗨Ben,

include()语句的工作方式与require()相同,

的区别是require()执行第一次解析语句是
,而每次执行语句

时都会调用include()。
Hi Ben,
the include() statement works in the same way of require(), with the
difference that require() is executed the first time the statement is
parsed, while include() is evluated each time the statement is
executed.



嗯,不太好。 require()和include()在各方面都是相同的

除了它们如何处理失败。如果由于某种原因无法包含文件

,则require()将导致整个脚本死亡,而

include将仅发出警告。


Umm, not quite. require() and include() are identical in every way
except for how they handle failure. If the file cannot be included
for some reason, require() will cause the entire script to die while
include will just throw a warning.



正确! :)

Correct! :)


这篇关于问题包括其他php文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆