How do I get text from a website using PHP?

后端 未结 7 1980
北海茫月
北海茫月 2020-12-31 11:33

So, I\'m working on a PHP script, and part of it needs to be able to query a website, then get text from it.

First off, I need to be able to query a certain website

相关标签:
7条回答
  • 2020-12-31 12:07

    If you have Curl installed, use it. Otherwise:

    $website = file_get_contents('http://google.com');
    

    Then you need to search through the string for the text you want. How you do that depends on the website, and the text you're trying to read.

    0 讨论(0)
提交回复
热议问题