gpt4 book ai didi

php - 添加和样式化外部文件

转载 作者:太空宇宙 更新时间:2023-11-03 19:51:26 24 4
gpt4 key购买 nike

另一个网站上有一个不属于我的文件,其 URL 格式如下:

http://example.com/path/with/some/variables

我想将此文件包含在我自己的页面之一中。我可以使用 iframe 来执行此操作,但我还想更改包含文件中某些内容的 CSS。据我所知,我不能用这种方法做到这一点。

但是,我似乎也无法通过 PHP 成功添加它,例如:

<?php include 'http://example.com/path/with/some/variables'; ?>

我不确定还有哪些其他方法可以做到这一点,但这肯定是可能的。

另外,我知道在这种情况下使用 include 的安全隐患。

最佳答案

使用读取文件:

<?php readfile('http://example.com/path/with/some/variables'); ?>

关于php - 添加和样式化外部文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23529082/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com