stupid question I think.
I have an API that i want to access. if I simply put the url in my browser it returns all the results correctly.
https://api.mydomain.com/v1/name?user=user1&pass=1234
in my browser this returns array information:
{"firstname":"John","Surname":"Smith"}
I want to be able to use PHP to simply assign the results of the URL page to a variable:
$url="https://api.mydomain.com/v1/name?user=user1&pass=1234";
$result=parse($url);
print_r($result);
This obviously doesnt work but just looking for the correct syntax. done some research but not getting any luck. should be so simple but is not.
advice appreciated as always. Thanks
parse_url().parse()? Because "parse()" isn't a core PHP function. php.net/manual-lookup.php?pattern=parse&scope=quickref -parse_url()is a core PHP function php.net/manual/en/function.parse-url.php if that's what you meant to use.