Hey, I tried so many ways to get contents from websites, cURL, getURL() and so on. But everytime it returns null. Can you give me the code to get contents from a website?
Utils::getURL("http://example.com") if you think that function does not work, try dumping this value first.
PHP: /** @var string $contents */$contents = \file_get_contents("http://www.example.com"); This will return the HTML code of a page.
Thanks, but at my last test it did return null, I heard that is because you cant do that with a local hosted server, is that true?
Are you sure Utils::getURL() returns null directly? It should either return a string, or return boolean false if there was an error. Did you do anything else wrong?
The HTTP content payload. A string is just a set of characters. What do you expect if it returns the text on the website? How would the text be like on forums.pocketmine.net?