extracting data from another webpage using codeign

2019-09-02 19:35发布

问题:

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

thanks in advance ~muttalebm

回答1:

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.