简体   繁体   English

如何在 PHP 中包含外部文件?

[英]How do I include external files in PHP?

This code works perfectly, but I can not find how to include an external file.这段代码运行良好,但我找不到如何包含外部文件。

www.free4g.me/-indexeddb/2.php www.free4g.me/-indexeddb/2.php

Can anyone show how to include a .php file of records?任何人都可以展示如何包含记录的 .php 文件吗?

<?php include_once 'PATH/TO/YOUR/FILE.php' ?>

OR或者

<?php require_once 'PATH/TO/YOUR/FILE.php' ?>

include = The file CAN be loaded, otherwise it will throw a notice. include = 文件可以被加载,否则会抛出一个通知。

require = The file HAS to be loaded, otherwise it will throw an error. require = 文件必须被加载,否则会抛出错误。

It's not possible include external files, per se.本身不可能包含外部文件。

PHP executes on your server. PHP 在您的服务器上执行。 You'll need to put the www.free4g.me/-indexeddb/2.php file on your server, after which you can include it using the explanation provided by Xatenev.您需要将www.free4g.me/-indexeddb/2.php文件放在您的服务器上,然后您可以使用 Xatenev 提供的说明将其包含在内。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM