我在 php 中所做的这个包含语句有什么问题? [英] what's wrong with this include statement that i did in php?

查看:41
本文介绍了我在 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 中所做的这个包含语句有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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