使用codeigniter从另一个网页提取数据 [英] extracting data from another webpage using codeigniter

查看:41
本文介绍了使用codeigniter从另一个网页提取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我什至不知道是否可能,但是这里的问题是
我有一个由CI创建的动态页面。现在,另一台服务器上的另一个页面是静态的。另一页有一个基本表,该表也是静态的。现在,我想从我的网页中加载其他页面。两个页面都位于不同的服务器上是否可以?如果是,谁能引导我

I don't even know whether it is possible or not but here goes my question I have a dynamic page created by CI. now there is another page on another server which is static. The other page has a basic table which is also static. Now I want to load that other page from my webpage. is it possible when both pages are located on different servers? If yes can anyone guide me

预先感谢
〜muttalebm

thanks in advance ~muttalebm

推荐答案

您可以使用 file_get_contents()并从页面中获取HTML并直接将其回显,或者,如果您想自定义HTML,请使用PHP的 DOMDocument 提取所需的部分(表),然后将其回显。顺便说一句,请确保已设置 allow_url_fopen 设置继续,否则您将无法获取远程内容。

You could use file_get_contents() and grab the HTML from the page and just echo it out, or if you want to customize that HTML use PHP's DOMDocument to extract the portion you want (table) and then echo it out. Btw make sure you have allow_url_fopen set to on, otherwise you will not be able to grab the remote content.

这篇关于使用codeigniter从另一个网页提取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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