gpt4 book ai didi

PHP:读取 html 文件以供离线阅读

转载 作者:行者123 更新时间:2023-11-30 10:44:36 25 4
gpt4 key购买 nike

我正在使用 file_get_contents() 函数读取 URL,例如:

$html = file_get_contents('www.mydomain.com');

现在我该如何修改上面的代码,或者我应该怎么做才能在我的数据库中保存后离线阅读页面。问题是保存的页面有图像和 css 指向获取的 url,这意味着互联网应该可以阅读它们。

我怎样才能让它同时保存图像和 CSS。我问过similar question在考虑 mht/mhtml 格式之前。

最佳答案

这就是你要找的吗?

http://www.phpclasses.org/package/1766-PHP-Build-MHT-MIME-archives-from-lists-of-files.html

http://www.wynia.org/wordpress/2006/12/making-mht-single-page-archive-files-with-php

请注意,MHT 是特定于 MS 的格式,因此上面的示例使用了 Windows 库。

关于PHP:读取 html 文件以供离线阅读,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9147956/

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