0

I want to get request in a website like that

$id = "something";
$response = http_get("http://example.com?id=$id, array("timeout"=>1), $out);

I don't find how exactly I can use http_get

I've tried with file_get_contents, it is working like

$out = file_get_contents("http://www.example.com?id=something");

but I want it like that

$out = file_get_contents("http://www.example.com?id=$id");

this one is not working

Ramazan Zor
  • 209
  • 1
  • 14

1 Answers1

0

The way I got it to work was using the code below.

$out = file_get_contents("http://www.example.com?id=".$id);

This will concatenate the $id variable contents onto the end of the url to request.

DjinnGA
  • 131
  • 4