1

I don't know why but I always got this error when I want to get PHP data with file_get_contents.

I have checked my PHP.ini and allow_url_fopen is: ON so that couldn't be the problem.

Here is the code I'm using:

$id='54352';
$url='http://www.google.com';
$data = file_get_contents('http://www.####.###/###.php?id='.$id.'&url='.urlencode($url));

var_dump($data);

I don't know what is going on here, I just get this error message and the value: bool(false).

I have also tried cURL, but it doesn't return ANY value to me.

Can anyone please help me?

kenorb
  • 155,785
  • 88
  • 678
  • 743
user1406071
  • 617
  • 4
  • 14
  • 24

1 Answers1

2

Try something like:

 $data = file_get_contents('http://www.####.###/###.php?id='.$id.'&url='.urlencode($url),true);
kenorb
  • 155,785
  • 88
  • 678
  • 743
NullPoiиteя
  • 56,591
  • 22
  • 125
  • 143