PhP download string from url

Discussion in 'Development' started by Defications2po, May 30, 2021.

  1. Defications2po

    Defications2po Witch

    Uh i was wondering if i could check a string from a url in php. I've used something similar to this in c++ and i was wondering if i could get a sneak peak of what it would look like in php. And before you ask no i have not tried to do it because i simply dont know where to start i have not touched php in 3 years now. And for those who dont understand what i am in need of i can give an example basically i want to use php to check my website and see if the string is "1.0" and if it is "1.0" the code continues etc.
  2. ErikX

    ErikX Baby Zombie

    Check out the Internet Documentation, you can use `getURL` to fetch a page.
    Then you can convert the string to json.
    Internet Documentation:
    function fetchJson(string $url){
    $data = \pocketmine\utils\Internet::getURL($url); // This will get the data on the url
    $jsondata json_decode($data); // Convert string to URL
    return $jsondata// Returns the Data
    $url ""// URL
    var_dump$this->fetchJson($url) );
    Defications2po likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.