How to display the contents of one site in another using PHP?

I'm trying to show the contents of two websites in each other, someone suggests I use an RSS reader, but my question is:

is there anything else i could try to show content besides using rss !?

I thought I could connect to the database of another website, but that did not work /

early

+3
source share
2 answers

Any PHP function that can retrieve remote URLs can help you with this. It can be as easy as doing

readfile('http://example.com'); // outputs contents of URL

URL- , DOM. XML-, RSS, , . , XSLT, HTML.

, , .

, , .

+2

- "readfile". "file_get_contents".

$home = file_get_contents('example.com');
echo $home;
+2

Source: https://habr.com/ru/post/1743304/


All Articles