what#39;s wrong with this include statement that i did in php?(我在 php 中所做的这个包含语句有什么问题?)
问题描述
<?php
include("articles/article_6.html");
?>
我希望将文章发布在我的网站上,但它给出了错误:
解析错误:语法错误,第 1 行/opt/lampp/htdocs/white_coats/articles/article_6.html 中的意外版本"(T_STRING)
Parse error: syntax error, unexpected 'version' (T_STRING) in /opt/lampp/htdocs/white_coats/articles/article_6.html on line 1
推荐答案
article_6.html 没有 php 标签.它只是一个保存在 .html 中的 word 文件,以便可以在网站上显示.这只是一篇带有一些图片的文章.
article_6.html has no php tags. its just a word file that was saved in .html so that it could be displayed on the website. it's just an article with some pictures.
那么你就不要包含它了.您阅读它的内容并打印它们.包含语句几乎总是用于代码包含,而不是纯 html 或文本内容.
Then you don't include it. You read it's contents and print em. Include statements are nearly always for code includes and not plain html or text content.
echo file_get_contents("articles/article_6.html");
这篇关于我在 php 中所做的这个包含语句有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:我在 php 中所做的这个包含语句有什么问题?
- SoapClient 设置自定义 HTTP Header 2021-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- Laravel 仓库 2022-01-01
- 带有通配符的 Laravel 验证器 2021-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01